Skip to content

Commit ba6be5f

Browse files
committed
Remove let_chains feature gate from even more tests
1 parent 5204067 commit ba6be5f

27 files changed

+46
-116
lines changed

tests/mir-opt/building/logical_or_in_conditional.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// skip-filecheck
22
//@ compile-flags: -Z validate-mir
3-
#![feature(let_chains)]
3+
//@ edition: 2024
44
struct Droppy(u8);
55
impl Drop for Droppy {
66
fn drop(&mut self) {

tests/ui/deriving/auxiliary/malicious-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(let_chains)]
1+
//@ edition: 2024
22

33
extern crate proc_macro;
44

tests/ui/drop/drop-order-comparisons.e2021.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//@ [e2024] edition: 2024
2525
//@ run-pass
2626

27-
#![feature(let_chains)]
27+
#![cfg_attr(e2021, feature(let_chains))]
2828
#![cfg_attr(e2021, warn(rust_2024_compatibility))]
2929

3030
fn t_bindings() {

tests/ui/drop/drop-order-comparisons.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//@ [e2024] edition: 2024
2525
//@ run-pass
2626

27-
#![feature(let_chains)]
27+
#![cfg_attr(e2021, feature(let_chains))]
2828
#![cfg_attr(e2021, warn(rust_2024_compatibility))]
2929

3030
fn t_bindings() {

tests/ui/lint/issue-121070-let-range.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
2+
//@ edition:2024
23

3-
#![feature(let_chains)]
44
#![allow(irrefutable_let_patterns)]
55
fn main() {
66
let _a = 0..1;

tests/ui/mir/issue-99852.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22
//@ compile-flags: -Z validate-mir
3-
#![feature(let_chains)]
3+
//@ edition: 2024
44

55
fn lambda<T, U>() -> U
66
where

tests/ui/parser/brace-in-let-chain.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// issue #117766
2+
//@ edition: 2024
23

3-
#![feature(let_chains)]
44
fn main() {
55
if let () = ()
66
&& let () = () {

tests/ui/parser/deli-ident-issue-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(let_chains)]
1+
//@ edition: 2024
22
trait Demo {}
33

44
impl dyn Demo {

tests/ui/parser/issues/issue-103381.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
//@ edition: 2024
12
//@ run-rustfix
23

3-
#![feature(let_chains)]
44
#![allow(unused_variables)]
55
#![allow(dead_code)]
66
#![allow(irrefutable_let_patterns)]

tests/ui/parser/semi-in-let-chain.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Issue #117720
2-
3-
#![feature(let_chains)]
2+
//@ edition: 2024
43

54
fn main() {
65
if let () = ()

tests/ui/rfcs/rfc-0000-never_patterns/diverges-not.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
//@ edition: 2024
12
#![feature(never_patterns)]
2-
#![feature(let_chains)]
33
#![allow(incomplete_features)]
44
#![deny(unreachable_patterns)]
55

tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs

-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ fn _if_let_guard() {
1515

1616
() if true && let 0 = 1 => {}
1717
//~^ ERROR `if let` guards are experimental
18-
//~| ERROR `let` expressions in this position are unstable
1918

2019
() if let 0 = 1 && true => {}
2120
//~^ ERROR `if let` guards are experimental
22-
//~| ERROR `let` expressions in this position are unstable
2321

2422
() if (let 0 = 1) && true => {}
2523
//~^ ERROR expected expression, found `let` statement
@@ -33,16 +31,13 @@ fn _if_let_guard() {
3331

3432
() if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
3533
//~^ ERROR `if let` guards are experimental
36-
//~| ERROR `let` expressions in this position are unstable
37-
//~| ERROR `let` expressions in this position are unstable
3834
//~| ERROR expected expression, found `let` statement
3935
//~| ERROR expected expression, found `let` statement
4036
//~| ERROR expected expression, found `let` statement
4137

4238

4339
() if let Range { start: _, end: _ } = (true..true) && false => {}
4440
//~^ ERROR `if let` guards are experimental
45-
//~| ERROR `let` expressions in this position are unstable
4641

4742
_ => {}
4843
}

tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr

+23-73
Original file line numberDiff line numberDiff line change
@@ -25,114 +25,114 @@ LL | () if (((let 0 = 1))) => {}
2525
| ^^^^^^^^^
2626

2727
error: expected expression, found `let` statement
28-
--> $DIR/feature-gate.rs:24:16
28+
--> $DIR/feature-gate.rs:22:16
2929
|
3030
LL | () if (let 0 = 1) && true => {}
3131
| ^^^^^^^^^
3232
|
3333
= note: only supported directly in conditions of `if` and `while` expressions
3434
note: `let`s wrapped in parentheses are not supported in a context with let chains
35-
--> $DIR/feature-gate.rs:24:16
35+
--> $DIR/feature-gate.rs:22:16
3636
|
3737
LL | () if (let 0 = 1) && true => {}
3838
| ^^^^^^^^^
3939

4040
error: expected expression, found `let` statement
41-
--> $DIR/feature-gate.rs:27:24
41+
--> $DIR/feature-gate.rs:25:24
4242
|
4343
LL | () if true && (let 0 = 1) => {}
4444
| ^^^^^^^^^
4545
|
4646
= note: only supported directly in conditions of `if` and `while` expressions
4747
note: `let`s wrapped in parentheses are not supported in a context with let chains
48-
--> $DIR/feature-gate.rs:27:24
48+
--> $DIR/feature-gate.rs:25:24
4949
|
5050
LL | () if true && (let 0 = 1) => {}
5151
| ^^^^^^^^^
5252

5353
error: expected expression, found `let` statement
54-
--> $DIR/feature-gate.rs:30:16
54+
--> $DIR/feature-gate.rs:28:16
5555
|
5656
LL | () if (let 0 = 1) && (let 0 = 1) => {}
5757
| ^^^^^^^^^
5858
|
5959
= note: only supported directly in conditions of `if` and `while` expressions
6060
note: `let`s wrapped in parentheses are not supported in a context with let chains
61-
--> $DIR/feature-gate.rs:30:16
61+
--> $DIR/feature-gate.rs:28:16
6262
|
6363
LL | () if (let 0 = 1) && (let 0 = 1) => {}
6464
| ^^^^^^^^^
6565

6666
error: expected expression, found `let` statement
67-
--> $DIR/feature-gate.rs:30:31
67+
--> $DIR/feature-gate.rs:28:31
6868
|
6969
LL | () if (let 0 = 1) && (let 0 = 1) => {}
7070
| ^^^^^^^^^
7171
|
7272
= note: only supported directly in conditions of `if` and `while` expressions
7373
note: `let`s wrapped in parentheses are not supported in a context with let chains
74-
--> $DIR/feature-gate.rs:30:31
74+
--> $DIR/feature-gate.rs:28:31
7575
|
7676
LL | () if (let 0 = 1) && (let 0 = 1) => {}
7777
| ^^^^^^^^^
7878

7979
error: expected expression, found `let` statement
80-
--> $DIR/feature-gate.rs:34:42
80+
--> $DIR/feature-gate.rs:32:42
8181
|
8282
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
8383
| ^^^^^^^^^
8484
|
8585
= note: only supported directly in conditions of `if` and `while` expressions
8686
note: `let`s wrapped in parentheses are not supported in a context with let chains
87-
--> $DIR/feature-gate.rs:34:42
87+
--> $DIR/feature-gate.rs:32:42
8888
|
8989
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
9090
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9191

9292
error: expected expression, found `let` statement
93-
--> $DIR/feature-gate.rs:34:55
93+
--> $DIR/feature-gate.rs:32:55
9494
|
9595
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
9696
| ^^^^^^^^^
9797
|
9898
= note: only supported directly in conditions of `if` and `while` expressions
9999
note: `let`s wrapped in parentheses are not supported in a context with let chains
100-
--> $DIR/feature-gate.rs:34:42
100+
--> $DIR/feature-gate.rs:32:42
101101
|
102102
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
103103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104104

105105
error: expected expression, found `let` statement
106-
--> $DIR/feature-gate.rs:34:68
106+
--> $DIR/feature-gate.rs:32:68
107107
|
108108
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
109109
| ^^^^^^^^^
110110
|
111111
= note: only supported directly in conditions of `if` and `while` expressions
112112
note: `let`s wrapped in parentheses are not supported in a context with let chains
113-
--> $DIR/feature-gate.rs:34:42
113+
--> $DIR/feature-gate.rs:32:42
114114
|
115115
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
116116
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117117

118118
error: expected expression, found `let` statement
119-
--> $DIR/feature-gate.rs:60:16
119+
--> $DIR/feature-gate.rs:55:16
120120
|
121121
LL | use_expr!((let 0 = 1 && 0 == 0));
122122
| ^^^
123123
|
124124
= note: only supported directly in conditions of `if` and `while` expressions
125125

126126
error: expected expression, found `let` statement
127-
--> $DIR/feature-gate.rs:62:16
127+
--> $DIR/feature-gate.rs:57:16
128128
|
129129
LL | use_expr!((let 0 = 1));
130130
| ^^^
131131
|
132132
= note: only supported directly in conditions of `if` and `while` expressions
133133

134134
error: no rules expected keyword `let`
135-
--> $DIR/feature-gate.rs:70:15
135+
--> $DIR/feature-gate.rs:65:15
136136
|
137137
LL | macro_rules! use_expr {
138138
| --------------------- when calling this macro
@@ -141,7 +141,7 @@ LL | use_expr!(let 0 = 1);
141141
| ^^^ no rules expected this token in macro call
142142
|
143143
note: while trying to match meta-variable `$e:expr`
144-
--> $DIR/feature-gate.rs:53:10
144+
--> $DIR/feature-gate.rs:48:10
145145
|
146146
LL | ($e:expr) => {
147147
| ^^^^^^^
@@ -169,7 +169,7 @@ LL | () if true && let 0 = 1 => {}
169169
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
170170

171171
error[E0658]: `if let` guards are experimental
172-
--> $DIR/feature-gate.rs:20:12
172+
--> $DIR/feature-gate.rs:19:12
173173
|
174174
LL | () if let 0 = 1 && true => {}
175175
| ^^^^^^^^^^^^^^^^^^^^
@@ -180,7 +180,7 @@ LL | () if let 0 = 1 && true => {}
180180
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
181181

182182
error[E0658]: `if let` guards are experimental
183-
--> $DIR/feature-gate.rs:34:12
183+
--> $DIR/feature-gate.rs:32:12
184184
|
185185
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
186186
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -191,7 +191,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 =
191191
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
192192

193193
error[E0658]: `if let` guards are experimental
194-
--> $DIR/feature-gate.rs:43:12
194+
--> $DIR/feature-gate.rs:39:12
195195
|
196196
LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
197197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -202,7 +202,7 @@ LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
202202
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
203203

204204
error[E0658]: `if let` guards are experimental
205-
--> $DIR/feature-gate.rs:66:12
205+
--> $DIR/feature-gate.rs:61:12
206206
|
207207
LL | () if let 0 = 1 => {}
208208
| ^^^^^^^^^^^^
@@ -212,56 +212,6 @@ LL | () if let 0 = 1 => {}
212212
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
213213
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
214214

215-
error[E0658]: `let` expressions in this position are unstable
216-
--> $DIR/feature-gate.rs:16:23
217-
|
218-
LL | () if true && let 0 = 1 => {}
219-
| ^^^^^^^^^
220-
|
221-
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
222-
= help: add `#![feature(let_chains)]` to the crate attributes to enable
223-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
224-
225-
error[E0658]: `let` expressions in this position are unstable
226-
--> $DIR/feature-gate.rs:20:15
227-
|
228-
LL | () if let 0 = 1 && true => {}
229-
| ^^^^^^^^^
230-
|
231-
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
232-
= help: add `#![feature(let_chains)]` to the crate attributes to enable
233-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
234-
235-
error[E0658]: `let` expressions in this position are unstable
236-
--> $DIR/feature-gate.rs:34:15
237-
|
238-
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
239-
| ^^^^^^^^^
240-
|
241-
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
242-
= help: add `#![feature(let_chains)]` to the crate attributes to enable
243-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
244-
245-
error[E0658]: `let` expressions in this position are unstable
246-
--> $DIR/feature-gate.rs:34:28
247-
|
248-
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
249-
| ^^^^^^^^^
250-
|
251-
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
252-
= help: add `#![feature(let_chains)]` to the crate attributes to enable
253-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
254-
255-
error[E0658]: `let` expressions in this position are unstable
256-
--> $DIR/feature-gate.rs:43:15
257-
|
258-
LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
259-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
260-
|
261-
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
262-
= help: add `#![feature(let_chains)]` to the crate attributes to enable
263-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
264-
265-
error: aborting due to 23 previous errors
215+
error: aborting due to 18 previous errors
266216

267217
For more information about this error, try `rustc --explain E0658`.

tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Expression macros can't expand to a let match guard.
22

33
#![feature(if_let_guard)]
4-
#![feature(let_chains)]
54

65
macro_rules! m {
76
($e:expr) => { let Some(x) = $e }

tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected expression, found `let` statement
2-
--> $DIR/macro-expanded.rs:7:20
2+
--> $DIR/macro-expanded.rs:6:20
33
|
44
LL | ($e:expr) => { let Some(x) = $e }
55
| ^^^

tests/ui/rfcs/rfc-2294-if-let-guard/move-guard-if-let-chain.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
//@ edition: 2024
12
#![feature(if_let_guard)]
2-
#![feature(let_chains)]
33
#![allow(irrefutable_let_patterns)]
44

55
fn same_pattern(c: bool) {

tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
//@ edition: 2024
12
// Parenthesised let "expressions" are not allowed in guards
23

34
#![feature(if_let_guard)]
4-
#![feature(let_chains)]
55

66
#[cfg(FALSE)]
77
fn un_cfged() {

tests/ui/rfcs/rfc-2294-if-let-guard/shadowing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Check shadowing in if let guards works as expected.
22
//@ check-pass
3+
//@ edition: 2024
34

45
#![feature(if_let_guard)]
5-
#![feature(let_chains)]
66

77
fn main() {
88
let x: Option<Option<i32>> = Some(Some(6));

tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ run-pass
2+
//@ edition: 2024
23

3-
#![feature(let_chains)]
44
#![allow(irrefutable_let_patterns)]
55

66
fn main() {

0 commit comments

Comments
 (0)