Remove let_chains feature gate from even more tests

This commit is contained in:
est31 2025-03-16 06:14:36 +01:00
parent d75f8cde2f
commit 162daaa2fa
30 changed files with 75 additions and 139 deletions

View file

@ -1,6 +1,6 @@
// skip-filecheck
//@ compile-flags: -Z validate-mir
#![feature(let_chains)]
//@ edition: 2024
struct Droppy(u8);
impl Drop for Droppy {
fn drop(&mut self) {

View file

@ -19,7 +19,7 @@ fn test_complex() -> () {
bb0: {
StorageLive(_1);
StorageLive(_2);
_2 = E::f() -> [return: bb1, unwind: bb34];
_2 = E::f() -> [return: bb1, unwind: bb35];
}
bb1: {
@ -42,7 +42,7 @@ fn test_complex() -> () {
bb5: {
StorageLive(_4);
_4 = always_true() -> [return: bb6, unwind: bb34];
_4 = always_true() -> [return: bb6, unwind: bb35];
}
bb6: {
@ -64,7 +64,7 @@ fn test_complex() -> () {
}
bb9: {
drop(_7) -> [return: bb11, unwind: bb34];
drop(_7) -> [return: bb11, unwind: bb35];
}
bb10: {
@ -78,7 +78,7 @@ fn test_complex() -> () {
}
bb12: {
drop(_7) -> [return: bb13, unwind: bb34];
drop(_7) -> [return: bb13, unwind: bb35];
}
bb13: {
@ -98,7 +98,7 @@ fn test_complex() -> () {
}
bb15: {
drop(_10) -> [return: bb17, unwind: bb34];
drop(_10) -> [return: bb17, unwind: bb35];
}
bb16: {
@ -113,11 +113,12 @@ fn test_complex() -> () {
bb18: {
_1 = const ();
StorageDead(_2);
goto -> bb22;
}
bb19: {
drop(_10) -> [return: bb20, unwind: bb34];
drop(_10) -> [return: bb20, unwind: bb35];
}
bb20: {
@ -127,6 +128,7 @@ fn test_complex() -> () {
}
bb21: {
StorageDead(_2);
_1 = const ();
goto -> bb22;
}
@ -135,10 +137,9 @@ fn test_complex() -> () {
StorageDead(_8);
StorageDead(_5);
StorageDead(_4);
StorageDead(_2);
StorageDead(_1);
StorageLive(_11);
_11 = always_true() -> [return: bb23, unwind: bb34];
_11 = always_true() -> [return: bb23, unwind: bb35];
}
bb23: {
@ -146,7 +147,7 @@ fn test_complex() -> () {
}
bb24: {
goto -> bb32;
goto -> bb33;
}
bb25: {
@ -155,7 +156,7 @@ fn test_complex() -> () {
bb26: {
StorageLive(_12);
_12 = E::f() -> [return: bb27, unwind: bb34];
_12 = E::f() -> [return: bb27, unwind: bb35];
}
bb27: {
@ -178,21 +179,26 @@ fn test_complex() -> () {
bb31: {
_0 = const ();
goto -> bb33;
StorageDead(_12);
goto -> bb34;
}
bb32: {
_0 = const ();
StorageDead(_12);
goto -> bb33;
}
bb33: {
_0 = const ();
goto -> bb34;
}
bb34: {
StorageDead(_11);
StorageDead(_12);
return;
}
bb34 (cleanup): {
bb35 (cleanup): {
resume;
}
}

View file

@ -1,4 +1,4 @@
#![feature(let_chains)]
//@ edition: 2024
extern crate proc_macro;

View file

@ -24,7 +24,7 @@
//@ [e2024] edition: 2024
//@ run-pass
#![feature(let_chains)]
#![cfg_attr(e2021, feature(let_chains))]
#![cfg_attr(e2021, warn(rust_2024_compatibility))]
fn t_bindings() {

View file

@ -24,7 +24,7 @@
//@ [e2024] edition: 2024
//@ run-pass
#![feature(let_chains)]
#![cfg_attr(e2021, feature(let_chains))]
#![cfg_attr(e2021, warn(rust_2024_compatibility))]
fn t_bindings() {

View file

@ -1,6 +1,6 @@
//@ check-pass
//@ edition:2024
#![feature(let_chains)]
#![allow(irrefutable_let_patterns)]
fn main() {
let _a = 0..1;

View file

@ -1,6 +1,6 @@
//@ check-pass
//@ compile-flags: -Z validate-mir
#![feature(let_chains)]
//@ edition: 2024
fn lambda<T, U>() -> U
where

View file

@ -1,6 +1,6 @@
// issue #117766
//@ edition: 2024
#![feature(let_chains)]
fn main() {
if let () = ()
&& let () = () {

View file

@ -1,4 +1,4 @@
#![feature(let_chains)]
//@ edition: 2024
trait Demo {}
impl dyn Demo {

View file

@ -1,6 +1,6 @@
//@ edition: 2024
//@ run-rustfix
#![feature(let_chains)]
#![allow(unused_variables)]
#![allow(dead_code)]
#![allow(irrefutable_let_patterns)]

View file

@ -1,6 +1,6 @@
//@ edition: 2024
//@ run-rustfix
#![feature(let_chains)]
#![allow(unused_variables)]
#![allow(dead_code)]
#![allow(irrefutable_let_patterns)]

View file

@ -1,6 +1,5 @@
// Issue #117720
#![feature(let_chains)]
//@ edition: 2024
fn main() {
if let () = ()

View file

@ -1,11 +1,11 @@
error: expected `{`, found `;`
--> $DIR/semi-in-let-chain.rs:7:23
--> $DIR/semi-in-let-chain.rs:6:23
|
LL | && let () = ();
| ^ expected `{`
|
note: you likely meant to continue parsing the let-chain starting here
--> $DIR/semi-in-let-chain.rs:8:9
--> $DIR/semi-in-let-chain.rs:7:9
|
LL | && let () = ()
| ^^^^^^
@ -16,13 +16,13 @@ LL + && let () = ()
|
error: expected `{`, found `;`
--> $DIR/semi-in-let-chain.rs:15:20
--> $DIR/semi-in-let-chain.rs:14:20
|
LL | && () == ();
| ^ expected `{`
|
note: the `if` expression is missing a block after this condition
--> $DIR/semi-in-let-chain.rs:14:8
--> $DIR/semi-in-let-chain.rs:13:8
|
LL | if let () = ()
| ________^
@ -30,13 +30,13 @@ LL | | && () == ();
| |___________________^
error: expected `{`, found `;`
--> $DIR/semi-in-let-chain.rs:23:20
--> $DIR/semi-in-let-chain.rs:22:20
|
LL | && () == ();
| ^ expected `{`
|
note: you likely meant to continue parsing the let-chain starting here
--> $DIR/semi-in-let-chain.rs:24:9
--> $DIR/semi-in-let-chain.rs:23:9
|
LL | && let () = ()
| ^^^^^^

View file

@ -1,5 +1,5 @@
//@ edition: 2024
#![feature(never_patterns)]
#![feature(let_chains)]
#![allow(incomplete_features)]
#![deny(unreachable_patterns)]

View file

@ -15,11 +15,9 @@ fn _if_let_guard() {
() if true && let 0 = 1 => {}
//~^ ERROR `if let` guards are experimental
//~| ERROR `let` expressions in this position are unstable
() if let 0 = 1 && true => {}
//~^ ERROR `if let` guards are experimental
//~| ERROR `let` expressions in this position are unstable
() if (let 0 = 1) && true => {}
//~^ ERROR expected expression, found `let` statement
@ -33,8 +31,6 @@ fn _if_let_guard() {
() if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
//~^ ERROR `if let` guards are experimental
//~| ERROR `let` expressions in this position are unstable
//~| ERROR `let` expressions in this position are unstable
//~| ERROR expected expression, found `let` statement
//~| ERROR expected expression, found `let` statement
//~| ERROR expected expression, found `let` statement
@ -42,7 +38,6 @@ fn _if_let_guard() {
() if let Range { start: _, end: _ } = (true..true) && false => {}
//~^ ERROR `if let` guards are experimental
//~| ERROR `let` expressions in this position are unstable
_ => {}
}

View file

@ -25,98 +25,98 @@ LL | () if (((let 0 = 1))) => {}
| ^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:24:16
--> $DIR/feature-gate.rs:22:16
|
LL | () if (let 0 = 1) && true => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:24:16
--> $DIR/feature-gate.rs:22:16
|
LL | () if (let 0 = 1) && true => {}
| ^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:27:24
--> $DIR/feature-gate.rs:25:24
|
LL | () if true && (let 0 = 1) => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:27:24
--> $DIR/feature-gate.rs:25:24
|
LL | () if true && (let 0 = 1) => {}
| ^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:30:16
--> $DIR/feature-gate.rs:28:16
|
LL | () if (let 0 = 1) && (let 0 = 1) => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:30:16
--> $DIR/feature-gate.rs:28:16
|
LL | () if (let 0 = 1) && (let 0 = 1) => {}
| ^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:30:31
--> $DIR/feature-gate.rs:28:31
|
LL | () if (let 0 = 1) && (let 0 = 1) => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:30:31
--> $DIR/feature-gate.rs:28:31
|
LL | () if (let 0 = 1) && (let 0 = 1) => {}
| ^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:34:42
--> $DIR/feature-gate.rs:32:42
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:34:42
--> $DIR/feature-gate.rs:32:42
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:34:55
--> $DIR/feature-gate.rs:32:55
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:34:42
--> $DIR/feature-gate.rs:32:42
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:34:68
--> $DIR/feature-gate.rs:32:68
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/feature-gate.rs:34:42
--> $DIR/feature-gate.rs:32:42
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:60:16
--> $DIR/feature-gate.rs:55:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^
@ -124,7 +124,7 @@ LL | use_expr!((let 0 = 1 && 0 == 0));
= note: only supported directly in conditions of `if` and `while` expressions
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:60:16
--> $DIR/feature-gate.rs:55:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^
@ -133,7 +133,7 @@ LL | use_expr!((let 0 = 1 && 0 == 0));
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:63:16
--> $DIR/feature-gate.rs:58:16
|
LL | use_expr!((let 0 = 1));
| ^^^
@ -141,7 +141,7 @@ LL | use_expr!((let 0 = 1));
= note: only supported directly in conditions of `if` and `while` expressions
error: expected expression, found `let` statement
--> $DIR/feature-gate.rs:63:16
--> $DIR/feature-gate.rs:58:16
|
LL | use_expr!((let 0 = 1));
| ^^^
@ -150,7 +150,7 @@ LL | use_expr!((let 0 = 1));
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: no rules expected keyword `let`
--> $DIR/feature-gate.rs:72:15
--> $DIR/feature-gate.rs:67:15
|
LL | macro_rules! use_expr {
| --------------------- when calling this macro
@ -159,7 +159,7 @@ LL | use_expr!(let 0 = 1);
| ^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$e:expr`
--> $DIR/feature-gate.rs:53:10
--> $DIR/feature-gate.rs:48:10
|
LL | ($e:expr) => {
| ^^^^^^^
@ -187,7 +187,7 @@ LL | () if true && let 0 = 1 => {}
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
--> $DIR/feature-gate.rs:20:12
--> $DIR/feature-gate.rs:19:12
|
LL | () if let 0 = 1 && true => {}
| ^^^^^^^^^^^^^^^^^^^^
@ -198,7 +198,7 @@ LL | () if let 0 = 1 && true => {}
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
--> $DIR/feature-gate.rs:34:12
--> $DIR/feature-gate.rs:32:12
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -209,7 +209,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 =
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
--> $DIR/feature-gate.rs:43:12
--> $DIR/feature-gate.rs:39:12
|
LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -220,7 +220,7 @@ LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
--> $DIR/feature-gate.rs:68:12
--> $DIR/feature-gate.rs:63:12
|
LL | () if let 0 = 1 => {}
| ^^^^^^^^^^^^
@ -230,56 +230,6 @@ LL | () if let 0 = 1 => {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are unstable
--> $DIR/feature-gate.rs:16:23
|
LL | () if true && let 0 = 1 => {}
| ^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
--> $DIR/feature-gate.rs:20:15
|
LL | () if let 0 = 1 && true => {}
| ^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
--> $DIR/feature-gate.rs:34:15
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
--> $DIR/feature-gate.rs:34:28
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `let` expressions in this position are unstable
--> $DIR/feature-gate.rs:43:15
|
LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 25 previous errors
error: aborting due to 20 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,7 +1,6 @@
// Expression macros can't expand to a let match guard.
#![feature(if_let_guard)]
#![feature(let_chains)]
macro_rules! m {
($e:expr) => { let Some(x) = $e }

View file

@ -1,5 +1,5 @@
error: expected expression, found `let` statement
--> $DIR/macro-expanded.rs:7:20
--> $DIR/macro-expanded.rs:6:20
|
LL | ($e:expr) => { let Some(x) = $e }
| ^^^

View file

@ -1,5 +1,5 @@
//@ edition: 2024
#![feature(if_let_guard)]
#![feature(let_chains)]
#![allow(irrefutable_let_patterns)]
fn same_pattern(c: bool) {

View file

@ -1,7 +1,7 @@
//@ edition: 2024
// Parenthesised let "expressions" are not allowed in guards
#![feature(if_let_guard)]
#![feature(let_chains)]
#[cfg(false)]
fn un_cfged() {

View file

@ -1,8 +1,8 @@
// Check shadowing in if let guards works as expected.
//@ check-pass
//@ edition: 2024
#![feature(if_let_guard)]
#![feature(let_chains)]
fn main() {
let x: Option<Option<i32>> = Some(Some(6));

View file

@ -1,6 +1,6 @@
//@ run-pass
//@ edition: 2024
#![feature(let_chains)]
#![allow(irrefutable_let_patterns)]
fn main() {

View file

@ -1,4 +1,4 @@
#![feature(let_chains)]
//@ edition: 2024
fn let_or_guard(x: Result<Option<i32>, ()>) {
match x {

View file

@ -1,4 +1,4 @@
#![feature(let_chains)]
//@ edition: 2024
fn main() {
let opt = Some(1i32);

View file

@ -1,6 +1,5 @@
//@ check-pass
#![feature(let_chains)]
//@ edition: 2024
fn main() {
let x = Some(vec!["test"]);

View file

@ -1,6 +1,5 @@
//@ check-pass
#![feature(let_chains)]
//@ edition:2024
fn main() {
let opt = Some("foo bar");

View file

@ -2,7 +2,6 @@ fn main() {
match true {
_ if let true = true && true => {}
//~^ ERROR `if let` guards are
//~| ERROR `let` expressions in this
_ => {}
}
}

View file

@ -9,16 +9,6 @@ LL | _ if let true = true && true => {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are unstable
--> $DIR/issue-93150.rs:3:14
|
LL | _ if let true = true && true => {}
| ^^^^^^^^^^^^^^^
|
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 2 previous errors
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,6 +1,7 @@
//@ compile-flags: -Zvalidate-mir -C opt-level=3
//@ build-pass
#![feature(let_chains)]
//@ edition: 2024
struct TupleIter<T, I: Iterator<Item = T>> {
inner: I,
}

View file

@ -3,7 +3,6 @@
//@ edition: 2024
//@ check-pass
#![feature(let_chains)]
#![allow(irrefutable_let_patterns)]
struct Pd;