Skip to content

Commit

Permalink
slice_patterns: remove gates in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Jan 18, 2020
1 parent 3e3cac0 commit a1eadca
Show file tree
Hide file tree
Showing 116 changed files with 349 additions and 490 deletions.
1 change: 0 additions & 1 deletion src/test/mir-opt/uniform_array_move_out.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(box_syntax)]
#![feature(slice_patterns)]

fn move_out_from_end() {
let a = [box 1, box 2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// run-pass

#![feature(slice_patterns, const_fn, const_if_match)]
#![feature(const_fn, const_if_match)]
#[derive(PartialEq, Debug, Clone)]
struct N(u8);

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/array-slice-vec/subslice-patterns-const-eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

// run-pass

#![feature(slice_patterns)]

#[derive(PartialEq, Debug, Clone)]
struct N(u8);

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/array-slice-vec/subslice-patterns-pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

// run-pass

#![feature(slice_patterns)]

#![allow(unreachable_patterns)]

use std::convert::identity;
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/array-slice-vec/vec-matching-fixed.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// run-pass

#![feature(slice_patterns)]

fn a() {
let x = [1, 2, 3];
match x {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/array-slice-vec/vec-matching-fold.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// run-pass

#![feature(slice_patterns)]

use std::fmt::Debug;

fn foldl<T, U, F>(values: &[T],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// run-pass
#![allow(unused_variables)]

#![feature(slice_patterns)]
#![allow(unused_variables)]

pub fn main() {
let x = &[1, 2, 3, 4, 5];
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/array-slice-vec/vec-matching.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// run-pass

#![feature(slice_patterns)]

fn a() {
let x = [1];
match x {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/array-slice-vec/vec-tail-matching.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// run-pass

#![feature(slice_patterns)]

struct Foo {
string: &'static str
}
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/binding/empty-types-in-patterns.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// run-pass

#![feature(never_type, never_type_fallback)]
#![feature(exhaustive_patterns)]
#![feature(slice_patterns)]

#![allow(unreachable_patterns)]
#![allow(unreachable_code)]
#![allow(unused_variables)]
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/binding/irrefutable-slice-patterns.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// run-pass
// #47096

#![feature(slice_patterns)]
// Regression test for #47096.

fn foo(s: &[i32]) -> &[i32] {
let &[ref xs @ ..] = s;
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/binding/match-byte-array-patterns.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
#![feature(slice_patterns)]

fn main() {
let buf = &[0u8; 4];
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/binding/match-vec-alternatives.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
#![feature(slice_patterns)]

fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str {
match (l1, l2) {
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/binding/zero_sized_subslice_match.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
#![feature(slice_patterns)]

fn main() {
let x = [(), ()];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Check that closure captures for slice patterns are inferred correctly

#![feature(slice_patterns)]
#![allow(unused_variables)]

// run-pass
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/borrowck/borrowck-closures-slice-patterns.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Check that closure captures for slice patterns are inferred correctly

#![feature(slice_patterns)]

fn arr_by_ref(mut x: [String; 3]) {
let f = || {
let [ref y, ref z @ ..] = x;
Expand Down
16 changes: 8 additions & 8 deletions src/test/ui/borrowck/borrowck-closures-slice-patterns.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-slice-patterns.rs:9:13
--> $DIR/borrowck-closures-slice-patterns.rs:7:13
|
LL | let f = || {
| -- immutable borrow occurs here
Expand All @@ -13,7 +13,7 @@ LL | f();
| - immutable borrow later used here

error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/borrowck-closures-slice-patterns.rs:18:13
--> $DIR/borrowck-closures-slice-patterns.rs:16:13
|
LL | let mut f = || {
| -- mutable borrow occurs here
Expand All @@ -27,7 +27,7 @@ LL | f();
| - mutable borrow later used here

error[E0382]: borrow of moved value: `x`
--> $DIR/borrowck-closures-slice-patterns.rs:27:5
--> $DIR/borrowck-closures-slice-patterns.rs:25:5
|
LL | fn arr_by_move(x: [String; 3]) {
| - move occurs because `x` has type `[std::string::String; 3]`, which does not implement the `Copy` trait
Expand All @@ -40,7 +40,7 @@ LL | &x;
| ^^ value borrowed here after move

error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-slice-patterns.rs:35:13
--> $DIR/borrowck-closures-slice-patterns.rs:33:13
|
LL | let f = || {
| -- immutable borrow occurs here
Expand All @@ -54,7 +54,7 @@ LL | f();
| - immutable borrow later used here

error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
--> $DIR/borrowck-closures-slice-patterns.rs:44:13
--> $DIR/borrowck-closures-slice-patterns.rs:42:13
|
LL | let mut f = || {
| -- closure construction occurs here
Expand All @@ -68,7 +68,7 @@ LL | f();
| - first borrow later used here

error[E0382]: borrow of moved value: `x`
--> $DIR/borrowck-closures-slice-patterns.rs:53:5
--> $DIR/borrowck-closures-slice-patterns.rs:51:5
|
LL | fn arr_box_by_move(x: Box<[String; 3]>) {
| - move occurs because `x` has type `std::boxed::Box<[std::string::String; 3]>`, which does not implement the `Copy` trait
Expand All @@ -81,7 +81,7 @@ LL | &x;
| ^^ value borrowed here after move

error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-closures-slice-patterns.rs:61:13
--> $DIR/borrowck-closures-slice-patterns.rs:59:13
|
LL | let f = || {
| -- immutable borrow occurs here
Expand All @@ -95,7 +95,7 @@ LL | f();
| - immutable borrow later used here

error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
--> $DIR/borrowck-closures-slice-patterns.rs:70:13
--> $DIR/borrowck-closures-slice-patterns.rs:68:13
|
LL | let mut f = || {
| -- closure construction occurs here
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/borrowck/borrowck-describe-lvalue.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// ignore-tidy-linelength

#![feature(slice_patterns)]

pub struct Foo {
x: u32
}
Expand Down
Loading

0 comments on commit a1eadca

Please sign in to comment.