Skip to content

Commit a1eadca

Browse files
committed
slice_patterns: remove gates in tests
1 parent 3e3cac0 commit a1eadca

File tree

116 files changed

+349
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+349
-490
lines changed

src/test/mir-opt/uniform_array_move_out.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(box_syntax)]
2-
#![feature(slice_patterns)]
32

43
fn move_out_from_end() {
54
let a = [box 1, box 2];

src/test/ui/array-slice-vec/subslice-patterns-const-eval-match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// run-pass
44

5-
#![feature(slice_patterns, const_fn, const_if_match)]
5+
#![feature(const_fn, const_if_match)]
66
#[derive(PartialEq, Debug, Clone)]
77
struct N(u8);
88

src/test/ui/array-slice-vec/subslice-patterns-const-eval.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
// run-pass
44

5-
#![feature(slice_patterns)]
6-
75
#[derive(PartialEq, Debug, Clone)]
86
struct N(u8);
97

src/test/ui/array-slice-vec/subslice-patterns-pass.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
// run-pass
66

7-
#![feature(slice_patterns)]
8-
97
#![allow(unreachable_patterns)]
108

119
use std::convert::identity;

src/test/ui/array-slice-vec/vec-matching-fixed.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(slice_patterns)]
4-
53
fn a() {
64
let x = [1, 2, 3];
75
match x {

src/test/ui/array-slice-vec/vec-matching-fold.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(slice_patterns)]
4-
53
use std::fmt::Debug;
64

75
fn foldl<T, U, F>(values: &[T],

src/test/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
2-
#![allow(unused_variables)]
32

4-
#![feature(slice_patterns)]
3+
#![allow(unused_variables)]
54

65
pub fn main() {
76
let x = &[1, 2, 3, 4, 5];

src/test/ui/array-slice-vec/vec-matching.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(slice_patterns)]
4-
53
fn a() {
64
let x = [1];
75
match x {

src/test/ui/array-slice-vec/vec-tail-matching.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// run-pass
22

3-
#![feature(slice_patterns)]
4-
53
struct Foo {
64
string: &'static str
75
}

src/test/ui/binding/empty-types-in-patterns.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// run-pass
2+
23
#![feature(never_type, never_type_fallback)]
34
#![feature(exhaustive_patterns)]
4-
#![feature(slice_patterns)]
5+
56
#![allow(unreachable_patterns)]
67
#![allow(unreachable_code)]
78
#![allow(unused_variables)]

src/test/ui/binding/irrefutable-slice-patterns.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
2-
// #47096
32

4-
#![feature(slice_patterns)]
3+
// Regression test for #47096.
54

65
fn foo(s: &[i32]) -> &[i32] {
76
let &[ref xs @ ..] = s;

src/test/ui/binding/match-byte-array-patterns.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(slice_patterns)]
32

43
fn main() {
54
let buf = &[0u8; 4];

src/test/ui/binding/match-vec-alternatives.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(slice_patterns)]
32

43
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str {
54
match (l1, l2) {

src/test/ui/binding/zero_sized_subslice_match.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(slice_patterns)]
32

43
fn main() {
54
let x = [(), ()];

src/test/ui/borrowck/borrowck-closures-slice-patterns-ok.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Check that closure captures for slice patterns are inferred correctly
22

3-
#![feature(slice_patterns)]
43
#![allow(unused_variables)]
54

65
// run-pass

src/test/ui/borrowck/borrowck-closures-slice-patterns.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Check that closure captures for slice patterns are inferred correctly
22

3-
#![feature(slice_patterns)]
4-
53
fn arr_by_ref(mut x: [String; 3]) {
64
let f = || {
75
let [ref y, ref z @ ..] = x;

src/test/ui/borrowck/borrowck-closures-slice-patterns.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
2-
--> $DIR/borrowck-closures-slice-patterns.rs:9:13
2+
--> $DIR/borrowck-closures-slice-patterns.rs:7:13
33
|
44
LL | let f = || {
55
| -- immutable borrow occurs here
@@ -13,7 +13,7 @@ LL | f();
1313
| - immutable borrow later used here
1414

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

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

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

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

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

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

9797
error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
98-
--> $DIR/borrowck-closures-slice-patterns.rs:70:13
98+
--> $DIR/borrowck-closures-slice-patterns.rs:68:13
9999
|
100100
LL | let mut f = || {
101101
| -- closure construction occurs here

src/test/ui/borrowck/borrowck-describe-lvalue.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(slice_patterns)]
4-
53
pub struct Foo {
64
x: u32
75
}

0 commit comments

Comments
 (0)