diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-03-08 20:09:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-08 20:09:02 +0100 |
| commit | 6a55aa1246114dcfffc022fd5218336c25dab1a4 (patch) | |
| tree | bb60b6711147a099360429c005cdff3e40184ee9 /src/test | |
| parent | 0ee2f4c3e050234ac977fdc8e44a43eb8e3c95a2 (diff) | |
| parent | aa7ac6e957747c0fc2edae126162bdfd8faff69c (diff) | |
Rollup merge of #82854 - estebank:issue-82827, r=oli-obk
Account for `if (let pat = expr) {}`
Fix #82827.
Diffstat (limited to 'src/test')
5 files changed, 176 insertions, 222 deletions
diff --git a/src/test/ui/pattern/issue-82290.stderr b/src/test/ui/pattern/issue-82290.stderr index 65ef018dc97..666b1e785bf 100644 --- a/src/test/ui/pattern/issue-82290.stderr +++ b/src/test/ui/pattern/issue-82290.stderr @@ -4,8 +4,7 @@ error: `let` expressions are not supported here LL | if true && let x = 1 { | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-82290.rs:1:12 diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr index 113870c19f5..00811fe3044 100644 --- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr +++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr @@ -15,6 +15,7 @@ LL | () if let 0 = 1 => {} | = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information = help: add `#![feature(if_let_guard)]` to the crate attributes to enable + = 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:76:12 @@ -24,6 +25,7 @@ LL | () if let 0 = 1 => {} | = note: see issue #51114 <https://github.com/rust-lang/rust/issues/51114> for more information = help: add `#![feature(if_let_guard)]` to the crate attributes to enable + = help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:10:16 @@ -33,6 +35,7 @@ LL | () if (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:14:18 @@ -42,6 +45,7 @@ LL | () if (((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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:18:23 @@ -51,6 +55,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:22:15 @@ -60,6 +65,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:26:16 @@ -69,6 +75,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:30:24 @@ -78,6 +85,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:34:16 @@ -87,6 +95,7 @@ LL | () if (let 0 = 1) && (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:34:31 @@ -96,6 +105,7 @@ LL | () if (let 0 = 1) && (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:40:15 @@ -105,6 +115,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:40:28 @@ -114,6 +125,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:40:42 @@ -123,6 +135,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:40:55 @@ -132,6 +145,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:40:68 @@ -141,6 +155,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:52:15 @@ -150,6 +165,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:68:16 @@ -159,6 +175,7 @@ LL | use_expr!((let 0 = 1 && 0 == 0)); | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:71:16 @@ -168,6 +185,7 @@ LL | use_expr!((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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error: `let` expressions are not supported here --> $DIR/feature-gate.rs:10:16 @@ -175,8 +193,7 @@ error: `let` expressions are not supported here LL | () if (let 0 = 1) => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:14:18 @@ -184,8 +201,7 @@ error: `let` expressions are not supported here LL | () if (((let 0 = 1))) => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:18:23 @@ -193,8 +209,7 @@ error: `let` expressions are not supported here LL | () if true && let 0 = 1 => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:22:15 @@ -202,8 +217,7 @@ error: `let` expressions are not supported here LL | () if let 0 = 1 && true => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:26:16 @@ -211,8 +225,7 @@ error: `let` expressions are not supported here LL | () if (let 0 = 1) && true => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:30:24 @@ -220,8 +233,7 @@ error: `let` expressions are not supported here LL | () if true && (let 0 = 1) => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:34:16 @@ -229,8 +241,7 @@ error: `let` expressions are not supported here LL | () if (let 0 = 1) && (let 0 = 1) => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:34:31 @@ -238,8 +249,7 @@ error: `let` expressions are not supported here LL | () if (let 0 = 1) && (let 0 = 1) => {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:40:15 @@ -247,8 +257,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:40:28 @@ -256,8 +265,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:40:42 @@ -265,8 +273,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:40:55 @@ -274,8 +281,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:40:68 @@ -283,8 +289,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:52:15 @@ -292,8 +297,7 @@ error: `let` expressions are not supported here LL | () if let Range { start: _, end: _ } = (true..true) && false => {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:68:16 @@ -301,8 +305,7 @@ error: `let` expressions are not supported here LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:71:16 @@ -310,8 +313,7 @@ error: `let` expressions are not supported here LL | use_expr!((let 0 = 1)); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: aborting due to 35 previous errors diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index 861a4a80ad6..1adce5e0150 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -15,8 +15,7 @@ error: `let` expressions are not supported here LL | if &let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:35:9 @@ -24,8 +23,7 @@ error: `let` expressions are not supported here LL | if !let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:36:9 @@ -33,8 +31,7 @@ error: `let` expressions are not supported here LL | if *let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:38:9 @@ -42,8 +39,7 @@ error: `let` expressions are not supported here LL | if -let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:46:9 @@ -51,8 +47,7 @@ error: `let` expressions are not supported here LL | if (let 0 = 0)? {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:50:16 @@ -60,8 +55,7 @@ error: `let` expressions are not supported here LL | if true || let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:51:17 @@ -69,8 +63,7 @@ error: `let` expressions are not supported here LL | if (true || let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:52:25 @@ -78,8 +71,7 @@ error: `let` expressions are not supported here LL | if true && (true || let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:53:25 @@ -87,8 +79,7 @@ error: `let` expressions are not supported here LL | if true || (true && let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:56:12 @@ -96,8 +87,7 @@ error: `let` expressions are not supported here LL | if x = let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:59:15 @@ -105,8 +95,7 @@ error: `let` expressions are not supported here LL | if true..(let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:61:11 @@ -114,8 +103,7 @@ error: `let` expressions are not supported here LL | if ..(let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:63:9 @@ -123,8 +111,7 @@ error: `let` expressions are not supported here LL | if (let 0 = 0).. {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:67:8 @@ -132,8 +119,7 @@ error: `let` expressions are not supported here LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:71:8 @@ -141,8 +127,7 @@ error: `let` expressions are not supported here LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:78:8 @@ -150,8 +135,7 @@ error: `let` expressions are not supported here LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:86:8 @@ -159,8 +143,7 @@ error: `let` expressions are not supported here LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:92:19 @@ -168,8 +151,7 @@ error: `let` expressions are not supported here LL | if let true = let true = true {} | ^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:96:12 @@ -177,8 +159,7 @@ error: `let` expressions are not supported here LL | while &let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:99:12 @@ -186,8 +167,7 @@ error: `let` expressions are not supported here LL | while !let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:100:12 @@ -195,8 +175,7 @@ error: `let` expressions are not supported here LL | while *let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:102:12 @@ -204,8 +183,7 @@ error: `let` expressions are not supported here LL | while -let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:110:12 @@ -213,8 +191,7 @@ error: `let` expressions are not supported here LL | while (let 0 = 0)? {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:114:19 @@ -222,8 +199,7 @@ error: `let` expressions are not supported here LL | while true || let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:115:20 @@ -231,8 +207,7 @@ error: `let` expressions are not supported here LL | while (true || let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:116:28 @@ -240,8 +215,7 @@ error: `let` expressions are not supported here LL | while true && (true || let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:117:28 @@ -249,8 +223,7 @@ error: `let` expressions are not supported here LL | while true || (true && let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:120:15 @@ -258,8 +231,7 @@ error: `let` expressions are not supported here LL | while x = let 0 = 0 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:123:18 @@ -267,8 +239,7 @@ error: `let` expressions are not supported here LL | while true..(let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:125:14 @@ -276,8 +247,7 @@ error: `let` expressions are not supported here LL | while ..(let 0 = 0) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:127:12 @@ -285,8 +255,7 @@ error: `let` expressions are not supported here LL | while (let 0 = 0).. {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:131:11 @@ -294,8 +263,7 @@ error: `let` expressions are not supported here LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:135:11 @@ -303,8 +271,7 @@ error: `let` expressions are not supported here LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:142:11 @@ -312,8 +279,7 @@ error: `let` expressions are not supported here LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:150:11 @@ -321,8 +287,7 @@ error: `let` expressions are not supported here LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:156:22 @@ -330,8 +295,7 @@ error: `let` expressions are not supported here LL | while let true = let true = true {} | ^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:170:6 @@ -339,8 +303,7 @@ error: `let` expressions are not supported here LL | &let 0 = 0; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:172:6 @@ -348,8 +311,7 @@ error: `let` expressions are not supported here LL | !let 0 = 0; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:173:6 @@ -357,8 +319,7 @@ error: `let` expressions are not supported here LL | *let 0 = 0; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:175:6 @@ -366,8 +327,7 @@ error: `let` expressions are not supported here LL | -let 0 = 0; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:183:6 @@ -375,8 +335,7 @@ error: `let` expressions are not supported here LL | (let 0 = 0)?; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:187:13 @@ -384,8 +343,7 @@ error: `let` expressions are not supported here LL | true || let 0 = 0; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:188:14 @@ -393,8 +351,7 @@ error: `let` expressions are not supported here LL | (true || let 0 = 0); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:189:22 @@ -402,8 +359,7 @@ error: `let` expressions are not supported here LL | true && (true || let 0 = 0); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:192:9 @@ -411,8 +367,7 @@ error: `let` expressions are not supported here LL | x = let 0 = 0; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:194:12 @@ -420,8 +375,7 @@ error: `let` expressions are not supported here LL | true..(let 0 = 0); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:195:8 @@ -429,8 +383,7 @@ error: `let` expressions are not supported here LL | ..(let 0 = 0); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:196:6 @@ -438,8 +391,7 @@ error: `let` expressions are not supported here LL | (let 0 = 0)..; | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:198:6 @@ -447,8 +399,7 @@ error: `let` expressions are not supported here LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:202:6 @@ -456,8 +407,7 @@ error: `let` expressions are not supported here LL | (let true = let true = true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:202:17 @@ -465,8 +415,7 @@ error: `let` expressions are not supported here LL | (let true = let true = true); | ^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:207:6 @@ -474,8 +423,7 @@ error: `let` expressions are not supported here LL | &let 0 = 0 | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:218:17 @@ -483,8 +431,7 @@ error: `let` expressions are not supported here LL | true && let 1 = 1 | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:222:17 @@ -492,8 +439,7 @@ error: `let` expressions are not supported here LL | true && let 1 = 1 | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:226:17 @@ -501,8 +447,7 @@ error: `let` expressions are not supported here LL | true && let 1 = 1 | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:236:17 @@ -510,8 +455,7 @@ error: `let` expressions are not supported here LL | true && let 1 = 1 | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/disallowed-positions.rs:20:12 diff --git a/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs b/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs index f5cb1860d47..0b38b5f47ef 100644 --- a/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs +++ b/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs @@ -13,11 +13,11 @@ fn _if() { if (let 0 = 1) {} //~^ ERROR `let` expressions in this position are experimental [E0658] - //~| ERROR `let` expressions are not supported here + //~| ERROR invalid parentheses around `let` expression in `if let` if (((let 0 = 1))) {} //~^ ERROR `let` expressions in this position are experimental [E0658] - //~| ERROR `let` expressions are not supported here + //~| ERROR invalid parentheses around `let` expression in `if let` if true && let 0 = 1 {} //~^ ERROR `let` expressions in this position are experimental [E0658] @@ -126,7 +126,7 @@ fn _macros() { //~| ERROR `let` expressions are not supported here use_expr!((let 0 = 1)); //~^ ERROR `let` expressions in this position are experimental [E0658] - //~| ERROR `let` expressions are not supported here + //~| ERROR invalid parentheses around `let` expression in `if let` //~| ERROR `let` expressions are not supported here #[cfg(FALSE)] (let 0 = 1); //~^ ERROR `let` expressions in this position are experimental [E0658] diff --git a/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr b/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr index 178e8627287..7364f62c922 100644 --- a/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr @@ -15,6 +15,7 @@ LL | if (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:18:11 @@ -24,6 +25,7 @@ LL | if (((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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:22:16 @@ -33,6 +35,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:26:8 @@ -42,6 +45,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:30:9 @@ -51,6 +55,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:34:17 @@ -60,6 +65,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:38:9 @@ -69,6 +75,7 @@ LL | if (let 0 = 1) && (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:38:24 @@ -78,6 +85,7 @@ LL | if (let 0 = 1) && (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:44:8 @@ -87,6 +95,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:44:21 @@ -96,6 +105,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:44:35 @@ -105,6 +115,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:44:48 @@ -114,6 +125,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:44:61 @@ -123,6 +135,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:56:8 @@ -132,6 +145,7 @@ 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:64:12 @@ -141,6 +155,7 @@ LL | while (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:68:14 @@ -150,6 +165,7 @@ LL | while (((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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:72:19 @@ -159,6 +175,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:76:11 @@ -168,6 +185,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:80:12 @@ -177,6 +195,7 @@ LL | while (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:84:20 @@ -186,6 +205,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:88:12 @@ -195,6 +215,7 @@ LL | while (let 0 = 1) && (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:88:27 @@ -204,6 +225,7 @@ LL | while (let 0 = 1) && (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:94:11 @@ -213,6 +235,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:94:24 @@ -222,6 +245,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:94:38 @@ -231,6 +255,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:94:51 @@ -240,6 +265,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:94:64 @@ -249,6 +275,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:106:11 @@ -258,6 +285,7 @@ LL | while 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:131:20 @@ -267,6 +295,7 @@ LL | #[cfg(FALSE)] (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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:114:17 @@ -276,6 +305,7 @@ LL | noop_expr!((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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:123:16 @@ -285,6 +315,7 @@ LL | use_expr!((let 0 = 1 && 0 == 0)); | = 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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` error[E0658]: `let` expressions in this position are experimental --> $DIR/feature-gate.rs:127:16 @@ -294,24 +325,29 @@ LL | use_expr!((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 + = help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>` -error: `let` expressions are not supported here - --> $DIR/feature-gate.rs:14:9 +error: invalid parentheses around `let` expression in `if let` + --> $DIR/feature-gate.rs:14:8 | LL | if (let 0 = 1) {} - | ^^^^^^^^^ + | ^ ^ + | +help: `if let` needs to be written without parentheses | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions +LL | if let 0 = 1 {} + | -- -- -error: `let` expressions are not supported here - --> $DIR/feature-gate.rs:18:11 +error: invalid parentheses around `let` expression in `if let` + --> $DIR/feature-gate.rs:18:8 | LL | if (((let 0 = 1))) {} - | ^^^^^^^^^ + | ^^^ ^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions +help: `if let` needs to be written without parentheses + | +LL | if let 0 = 1 {} + | -- -- error: `let` expressions are not supported here --> $DIR/feature-gate.rs:22:16 @@ -319,8 +355,7 @@ error: `let` expressions are not supported here LL | if true && let 0 = 1 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:26:8 @@ -328,8 +363,7 @@ error: `let` expressions are not supported here LL | if let 0 = 1 && true {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:30:9 @@ -337,8 +371,7 @@ error: `let` expressions are not supported here LL | if (let 0 = 1) && true {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:34:17 @@ -346,8 +379,7 @@ error: `let` expressions are not supported here LL | if true && (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:38:9 @@ -355,8 +387,7 @@ error: `let` expressions are not supported here LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:38:24 @@ -364,8 +395,7 @@ error: `let` expressions are not supported here LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:44:8 @@ -373,8 +403,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:44:21 @@ -382,8 +411,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:44:35 @@ -391,8 +419,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:44:48 @@ -400,8 +427,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:44:61 @@ -409,8 +435,7 @@ error: `let` expressions are not supported here 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:56:8 @@ -418,8 +443,7 @@ error: `let` expressions are not supported here LL | if let Range { start: _, end: _ } = (true..true) && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:64:12 @@ -427,8 +451,7 @@ error: `let` expressions are not supported here LL | while (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:68:14 @@ -436,8 +459,7 @@ error: `let` expressions are not supported here LL | while (((let 0 = 1))) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:72:19 @@ -445,8 +467,7 @@ error: `let` expressions are not supported here LL | while true && let 0 = 1 {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:76:11 @@ -454,8 +475,7 @@ error: `let` expressions are not supported here LL | while let 0 = 1 && true {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:80:12 @@ -463,8 +483,7 @@ error: `let` expressions are not supported here LL | while (let 0 = 1) && true {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:84:20 @@ -472,8 +491,7 @@ error: `let` expressions are not supported here LL | while true && (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:88:12 @@ -481,8 +499,7 @@ error: `let` expressions are not supported here LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:88:27 @@ -490,8 +507,7 @@ error: `let` expressions are not supported here LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:94:11 @@ -499,8 +515,7 @@ error: `let` expressions are not supported here LL | while 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:94:24 @@ -508,8 +523,7 @@ error: `let` expressions are not supported here LL | while 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:94:38 @@ -517,8 +531,7 @@ error: `let` expressions are not supported here LL | while 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:94:51 @@ -526,8 +539,7 @@ error: `let` expressions are not supported here LL | while 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:94:64 @@ -535,8 +547,7 @@ error: `let` expressions are not supported here LL | while 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: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:106:11 @@ -544,8 +555,7 @@ error: `let` expressions are not supported here LL | while let Range { start: _, end: _ } = (true..true) && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:123:16 @@ -553,8 +563,7 @@ error: `let` expressions are not supported here LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: `let` expressions are not supported here --> $DIR/feature-gate.rs:123:16 @@ -562,17 +571,18 @@ error: `let` expressions are not supported here LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses -error: `let` expressions are not supported here - --> $DIR/feature-gate.rs:127:16 +error: invalid parentheses around `let` expression in `if let` + --> $DIR/feature-gate.rs:127:15 | LL | use_expr!((let 0 = 1)); - | ^^^^^^^^^ + | ^ ^ + | +help: `if let` needs to be written without parentheses | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions +LL | use_expr!(let 0 = 1); + | -- -- error: `let` expressions are not supported here --> $DIR/feature-gate.rs:127:16 @@ -580,8 +590,7 @@ error: `let` expressions are not supported here LL | use_expr!((let 0 = 1)); | ^^^^^^^^^ | - = note: only supported directly in conditions of `if`- and `while`-expressions - = note: as well as when nested within `&&` and parenthesis in those conditions + = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses error: aborting due to 65 previous errors |
