about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-14 19:56:55 +0000
committerbors <bors@rust-lang.org>2023-09-14 19:56:55 +0000
commitdac91a82e146d89fefe94dcbb53cd6c2662e354f (patch)
treeb17e0f57c57a47fb6d4b54df4313174f090ee4e3 /tests
parentccf817b9bbe449204a227430d0a84a4f1d1798cc (diff)
parente324a59eb6ba1a7883bf23ff42d425ca96960f2a (diff)
downloadrust-dac91a82e146d89fefe94dcbb53cd6c2662e354f.tar.gz
rust-dac91a82e146d89fefe94dcbb53cd6c2662e354f.zip
Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naber
Improve invalid let expression handling

- Move all of the checks for valid let expression positions to parsing.
- Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location.
- Suppress some later errors and MIR construction for invalid let expressions.
- Fix a (drop) scope issue that was also responsible for #104172.

Fixes #104172
Fixes #104868
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/pprust-expr-roundtrip.rs20
-rw-r--r--tests/ui/expr/if/bad-if-let-suggestion.rs3
-rw-r--r--tests/ui/expr/if/bad-if-let-suggestion.stderr23
-rw-r--r--tests/ui/mir/issue-92893.rs4
-rw-r--r--tests/ui/mir/issue-92893.stderr18
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs36
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr285
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.stderr1
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs2
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/parens.stderr34
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs2
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr2
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.rs14
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr10
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.rs340
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.stderr1021
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs261
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr1462
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs1
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr30
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs6
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr30
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs2
-rw-r--r--tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr36
24 files changed, 1904 insertions, 1739 deletions
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
index ae375dfab90..541be7ebbc0 100644
--- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -80,14 +80,20 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
                 let seg = PathSegment::from_ident(Ident::from_str("x"));
                 iter_exprs(depth - 1, &mut |e| {
                     g(ExprKind::MethodCall(Box::new(MethodCall {
-                        seg: seg.clone(), receiver: e, args: thin_vec![make_x()], span: DUMMY_SP
-                    }))
-                )});
+                        seg: seg.clone(),
+                        receiver: e,
+                        args: thin_vec![make_x()],
+                        span: DUMMY_SP,
+                    })))
+                });
                 iter_exprs(depth - 1, &mut |e| {
                     g(ExprKind::MethodCall(Box::new(MethodCall {
-                        seg: seg.clone(), receiver: make_x(), args: thin_vec![e], span: DUMMY_SP
-                    }))
-                )});
+                        seg: seg.clone(),
+                        receiver: make_x(),
+                        args: thin_vec![e],
+                        span: DUMMY_SP,
+                    })))
+                });
             }
             2..=7 => {
                 let op = Spanned {
@@ -174,7 +180,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
             18 => {
                 let pat =
                     P(Pat { id: DUMMY_NODE_ID, kind: PatKind::Wild, span: DUMMY_SP, tokens: None });
-                iter_exprs(depth - 1, &mut |e| g(ExprKind::Let(pat.clone(), e, DUMMY_SP)))
+                iter_exprs(depth - 1, &mut |e| g(ExprKind::Let(pat.clone(), e, DUMMY_SP, None)))
             }
             _ => panic!("bad counter value in iter_exprs"),
         }
diff --git a/tests/ui/expr/if/bad-if-let-suggestion.rs b/tests/ui/expr/if/bad-if-let-suggestion.rs
index a8b2a283039..99d584ac7a5 100644
--- a/tests/ui/expr/if/bad-if-let-suggestion.rs
+++ b/tests/ui/expr/if/bad-if-let-suggestion.rs
@@ -4,9 +4,8 @@
 fn a() {
     if let x = 1 && i = 2 {}
     //~^ ERROR cannot find value `i` in this scope
-    //~| ERROR `let` expressions in this position are unstable
     //~| ERROR mismatched types
-    //~| ERROR `let` expressions are not supported here
+    //~| ERROR expected expression, found `let` statement
 }
 
 fn b() {
diff --git a/tests/ui/expr/if/bad-if-let-suggestion.stderr b/tests/ui/expr/if/bad-if-let-suggestion.stderr
index 3a53a20b453..20ac9ca76ba 100644
--- a/tests/ui/expr/if/bad-if-let-suggestion.stderr
+++ b/tests/ui/expr/if/bad-if-let-suggestion.stderr
@@ -1,4 +1,4 @@
-error: `let` expressions are not supported here
+error: expected expression, found `let` statement
   --> $DIR/bad-if-let-suggestion.rs:5:8
    |
 LL |     if let x = 1 && i = 2 {}
@@ -13,7 +13,7 @@ LL |     if let x = 1 && i = 2 {}
    |                     ^ not found in this scope
 
 error[E0425]: cannot find value `i` in this scope
-  --> $DIR/bad-if-let-suggestion.rs:13:9
+  --> $DIR/bad-if-let-suggestion.rs:12:9
    |
 LL | fn a() {
    | ------ similarly named function `a` defined here
@@ -22,7 +22,7 @@ LL |     if (i + j) = i {}
    |         ^ help: a function with a similar name exists: `a`
 
 error[E0425]: cannot find value `j` in this scope
-  --> $DIR/bad-if-let-suggestion.rs:13:13
+  --> $DIR/bad-if-let-suggestion.rs:12:13
    |
 LL | fn a() {
    | ------ similarly named function `a` defined here
@@ -31,7 +31,7 @@ LL |     if (i + j) = i {}
    |             ^ help: a function with a similar name exists: `a`
 
 error[E0425]: cannot find value `i` in this scope
-  --> $DIR/bad-if-let-suggestion.rs:13:18
+  --> $DIR/bad-if-let-suggestion.rs:12:18
    |
 LL | fn a() {
    | ------ similarly named function `a` defined here
@@ -40,7 +40,7 @@ LL |     if (i + j) = i {}
    |                  ^ help: a function with a similar name exists: `a`
 
 error[E0425]: cannot find value `x` in this scope
-  --> $DIR/bad-if-let-suggestion.rs:20:8
+  --> $DIR/bad-if-let-suggestion.rs:19:8
    |
 LL | fn a() {
    | ------ similarly named function `a` defined here
@@ -48,15 +48,6 @@ LL | fn a() {
 LL |     if x[0] = 1 {}
    |        ^ help: a function with a similar name exists: `a`
 
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/bad-if-let-suggestion.rs:5:8
-   |
-LL |     if let x = 1 && i = 2 {}
-   |        ^^^^^^^^^
-   |
-   = 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
-
 error[E0308]: mismatched types
   --> $DIR/bad-if-let-suggestion.rs:5:8
    |
@@ -68,7 +59,7 @@ help: you might have meant to compare for equality
 LL |     if let x = 1 && i == 2 {}
    |                        +
 
-error: aborting due to 8 previous errors
+error: aborting due to 7 previous errors
 
-Some errors have detailed explanations: E0308, E0425, E0658.
+Some errors have detailed explanations: E0308, E0425.
 For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/mir/issue-92893.rs b/tests/ui/mir/issue-92893.rs
index 635050f376c..6127d267ebc 100644
--- a/tests/ui/mir/issue-92893.rs
+++ b/tests/ui/mir/issue-92893.rs
@@ -1,7 +1,5 @@
 struct Bug<A = [(); (let a = (), 1).1]> {
-    //~^ `let` expressions are not supported here
-    //~| `let` expressions in this position are unstable [E0658]
-    //~| expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     a: A
 }
 
diff --git a/tests/ui/mir/issue-92893.stderr b/tests/ui/mir/issue-92893.stderr
index 4a0fcce31d7..6c1a9dc0317 100644
--- a/tests/ui/mir/issue-92893.stderr
+++ b/tests/ui/mir/issue-92893.stderr
@@ -3,24 +3,8 @@ error: expected expression, found `let` statement
    |
 LL | struct Bug<A = [(); (let a = (), 1).1]> {
    |                      ^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/issue-92893.rs:1:22
-   |
-LL | struct Bug<A = [(); (let a = (), 1).1]> {
-   |                      ^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/issue-92893.rs:1:22
-   |
-LL | struct Bug<A = [(); (let a = (), 1).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
-
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs
index 3beb20f0a37..b8c0eb3e6d6 100644
--- a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs
@@ -8,14 +8,10 @@ fn _if_let_guard() {
         //~^ ERROR `if let` guards are experimental
 
         () if (let 0 = 1) => {}
-        //~^ ERROR `let` expressions in this position are unstable
-        //~| ERROR expected expression, found `let` statement
-        //~| ERROR `let` expressions are not supported here
+        //~^ ERROR expected expression, found `let` statement
 
         () if (((let 0 = 1))) => {}
-        //~^ ERROR `let` expressions in this position are unstable
-        //~| ERROR expected expression, found `let` statement
-        //~| ERROR `let` expressions are not supported here
+        //~^ ERROR expected expression, found `let` statement
 
         () if true && let 0 = 1 => {}
         //~^ ERROR `if let` guards are experimental
@@ -26,36 +22,22 @@ fn _if_let_guard() {
         //~| ERROR `let` expressions in this position are unstable
 
         () if (let 0 = 1) && true => {}
-        //~^ ERROR `let` expressions in this position are unstable
-        //~| ERROR expected expression, found `let` statement
-        //~| ERROR `let` expressions are not supported here
+        //~^ ERROR expected expression, found `let` statement
 
         () if true && (let 0 = 1) => {}
-        //~^ ERROR `let` expressions in this position are unstable
-        //~| ERROR expected expression, found `let` statement
-        //~| ERROR `let` expressions are not supported here
+        //~^ ERROR expected expression, found `let` statement
 
         () if (let 0 = 1) && (let 0 = 1) => {}
-        //~^ 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
-        //~| ERROR `let` expressions are not supported here
-        //~| ERROR `let` expressions are not supported here
 
         () 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 `let` expressions in this position are unstable
-        //~| 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
-        //~| ERROR `let` expressions are not supported here
-        //~| ERROR `let` expressions are not supported here
-        //~| ERROR `let` expressions are not supported here
 
 
         () if let Range { start: _, end: _ } = (true..true) && false => {}
@@ -76,13 +58,9 @@ fn _macros() {
         }
     }
     use_expr!((let 0 = 1 && 0 == 0));
-    //~^ ERROR `let` expressions in this position are unstable
-    //~| ERROR expected expression, found `let` statement
-    //~| ERROR `let` expressions are not supported here
+    //~^ ERROR expected expression, found `let` statement
     use_expr!((let 0 = 1));
-    //~^ ERROR `let` expressions in this position are unstable
-    //~| ERROR expected expression, found `let` statement
-    //~| ERROR `let` expressions are not supported here
+    //~^ ERROR expected expression, found `let` statement
     match () {
         #[cfg(FALSE)]
         () if let 0 = 1 => {}
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr
index dc182ce464a..62534b555b2 100644
--- a/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr
@@ -2,87 +2,6 @@ error: expected expression, found `let` statement
   --> $DIR/feature-gate.rs:10:16
    |
 LL |         () if (let 0 = 1) => {}
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:15:18
-   |
-LL |         () if (((let 0 = 1))) => {}
-   |                  ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:28:16
-   |
-LL |         () if (let 0 = 1) && true => {}
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:33:24
-   |
-LL |         () if true && (let 0 = 1) => {}
-   |                        ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:38:16
-   |
-LL |         () if (let 0 = 1) && (let 0 = 1) => {}
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:38:31
-   |
-LL |         () if (let 0 = 1) && (let 0 = 1) => {}
-   |                               ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:46: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:46:55
-   |
-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:46:68
-   |
-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:78:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:82:16
-   |
-LL |     use_expr!((let 0 = 1));
-   |                ^^^
-
-error: no rules expected the token `let`
-  --> $DIR/feature-gate.rs:92:15
-   |
-LL |     macro_rules! use_expr {
-   |     --------------------- when calling this macro
-...
-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:71:10
-   |
-LL |         ($e:expr) => {
-   |          ^^^^^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:10:16
-   |
-LL |         () if (let 0 = 1) => {}
    |                ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
@@ -92,135 +11,140 @@ note: `let`s wrapped in parentheses are not supported in a context with let chai
 LL |         () if (let 0 = 1) => {}
    |                ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:15:18
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:13:18
    |
 LL |         () if (((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:15:18
+  --> $DIR/feature-gate.rs:13:18
    |
 LL |         () if (((let 0 = 1))) => {}
    |                  ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:28:16
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:24: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:28:16
+  --> $DIR/feature-gate.rs:24:16
    |
 LL |         () if (let 0 = 1) && true => {}
    |                ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:33:24
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:27: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:33:24
+  --> $DIR/feature-gate.rs:27:24
    |
 LL |         () if true && (let 0 = 1) => {}
    |                        ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:38:16
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:30: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:38:16
+  --> $DIR/feature-gate.rs:30:16
    |
 LL |         () if (let 0 = 1) && (let 0 = 1) => {}
    |                ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:38:31
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:30: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:38:31
+  --> $DIR/feature-gate.rs:30:31
    |
 LL |         () if (let 0 = 1) && (let 0 = 1) => {}
    |                               ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:46:42
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:34: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:46:42
+  --> $DIR/feature-gate.rs:34:42
    |
 LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:46:55
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:34: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:46:42
+  --> $DIR/feature-gate.rs:34:42
    |
 LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:46:68
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:34: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:46:42
+  --> $DIR/feature-gate.rs:34:42
    |
 LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:78:16
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:60:16
    |
 LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^^^^^^^
+   |                ^^^
    |
    = 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:78:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/feature-gate.rs:82:16
+error: expected expression, found `let` statement
+  --> $DIR/feature-gate.rs:62:16
    |
 LL |     use_expr!((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:82:16
+
+error: no rules expected the token `let`
+  --> $DIR/feature-gate.rs:70:15
    |
-LL |     use_expr!((let 0 = 1));
-   |                ^^^^^^^^^
+LL |     macro_rules! use_expr {
+   |     --------------------- when calling this macro
+...
+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
+   |
+LL |         ($e:expr) => {
+   |          ^^^^^^^
 
 error[E0658]: `if let` guards are experimental
   --> $DIR/feature-gate.rs:7:12
@@ -233,7 +157,7 @@ LL |         () if 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:16:12
    |
 LL |         () if true && let 0 = 1 => {}
    |            ^^^^^^^^^^^^^^^^^^^^
@@ -243,7 +167,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:24:12
+  --> $DIR/feature-gate.rs:20:12
    |
 LL |         () if let 0 = 1 && true => {}
    |            ^^^^^^^^^^^^^^^^^^^^
@@ -253,7 +177,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:46:12
+  --> $DIR/feature-gate.rs:34:12
    |
 LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -263,7 +187,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:61:12
+  --> $DIR/feature-gate.rs:43:12
    |
 LL |         () if let Range { start: _, end: _ } = (true..true) && false => {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -273,7 +197,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:88:12
+  --> $DIR/feature-gate.rs:66:12
    |
 LL |         () if let 0 = 1 => {}
    |            ^^^^^^^^^^^^
@@ -283,25 +207,7 @@ LL |         () if let 0 = 1 => {}
    = 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:10:16
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:15:18
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:20:23
+  --> $DIR/feature-gate.rs:16:23
    |
 LL |         () if true && let 0 = 1 => {}
    |                       ^^^^^^^^^
@@ -310,7 +216,7 @@ LL |         () if true && let 0 = 1 => {}
    = help: add `#![feature(let_chains)]` to the crate attributes to enable
 
 error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:24:15
+  --> $DIR/feature-gate.rs:20:15
    |
 LL |         () if let 0 = 1 && true => {}
    |               ^^^^^^^^^
@@ -319,43 +225,7 @@ LL |         () if let 0 = 1 && true => {}
    = help: add `#![feature(let_chains)]` to the crate attributes to enable
 
 error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:28:16
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:33:24
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:38:16
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:38:31
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:46:15
+  --> $DIR/feature-gate.rs:34:15
    |
 LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
    |               ^^^^^^^^^
@@ -364,7 +234,7 @@ LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 =
    = help: add `#![feature(let_chains)]` to the crate attributes to enable
 
 error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:46:28
+  --> $DIR/feature-gate.rs:34:28
    |
 LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
    |                            ^^^^^^^^^
@@ -373,34 +243,7 @@ LL |         () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 =
    = help: add `#![feature(let_chains)]` to the crate attributes to enable
 
 error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:46:42
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:46:55
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:46:68
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:61:15
+  --> $DIR/feature-gate.rs:43:15
    |
 LL |         () if let Range { start: _, end: _ } = (true..true) && false => {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -408,24 +251,6 @@ 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
 
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:78:16
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:82:16
-   |
-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
-
-error: aborting due to 45 previous errors
+error: aborting due to 23 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.stderr
index 41a20bf8ae1..00c1c303d2b 100644
--- a/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.stderr
@@ -7,6 +7,7 @@ LL |     ($e:expr) => { let Some(x) = $e }
 LL |         () if m!(Some(5)) => {}
    |               ----------- in this macro invocation
    |
+   = note: only supported directly in conditions of `if` and `while` expressions
    = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs
index 9cb27c73b14..f12824db9c0 100644
--- a/tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/parens.rs
@@ -19,9 +19,7 @@ fn main() {
         () if let 0 = 1 => {}
         () if (let 0 = 1) => {}
         //~^ ERROR expected expression, found `let` statement
-        //~| ERROR `let` expressions are not supported here
         () if (((let 0 = 1))) => {}
         //~^ ERROR expected expression, found `let` statement
-        //~| ERROR `let` expressions are not supported here
     }
 }
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/parens.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/parens.stderr
index 85df360daab..0c16d9c5442 100644
--- a/tests/ui/rfcs/rfc-2294-if-let-guard/parens.stderr
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/parens.stderr
@@ -2,27 +2,29 @@ error: expected expression, found `let` statement
   --> $DIR/parens.rs:10:16
    |
 LL |         () if (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/parens.rs:10:16
+   |
+LL |         () if (let 0 = 1) => {}
+   |                ^^^^^^^^^
 
 error: expected expression, found `let` statement
   --> $DIR/parens.rs:12:18
    |
 LL |         () if (((let 0 = 1))) => {}
-   |                  ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/parens.rs:20:16
+   |                  ^^^^^^^^^
    |
-LL |         () if (let 0 = 1) => {}
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/parens.rs:23:18
+   = 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/parens.rs:12:18
    |
 LL |         () if (((let 0 = 1))) => {}
-   |                  ^^^
+   |                  ^^^^^^^^^
 
-error: `let` expressions are not supported here
+error: expected expression, found `let` statement
   --> $DIR/parens.rs:20:16
    |
 LL |         () if (let 0 = 1) => {}
@@ -35,18 +37,18 @@ note: `let`s wrapped in parentheses are not supported in a context with let chai
 LL |         () if (let 0 = 1) => {}
    |                ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/parens.rs:23:18
+error: expected expression, found `let` statement
+  --> $DIR/parens.rs:22:18
    |
 LL |         () if (((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/parens.rs:23:18
+  --> $DIR/parens.rs:22:18
    |
 LL |         () if (((let 0 = 1))) => {}
    |                  ^^^^^^^^^
 
-error: aborting due to 6 previous errors
+error: aborting due to 4 previous errors
 
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs
index e6dee2a1d06..cb3be59bee0 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs
@@ -3,7 +3,7 @@
 fn let_or_guard(x: Result<Option<i32>, ()>) {
     match x {
         Ok(opt) if let Some(4) = opt || false  => {}
-        //~^ ERROR `let` expressions are not supported here
+        //~^ ERROR expected expression, found `let` statement
         _ => {}
     }
 }
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr
index 26850998cc4..4b85fdd5050 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr
@@ -1,4 +1,4 @@
-error: `let` expressions are not supported here
+error: expected expression, found `let` statement
   --> $DIR/ast-validate-guards.rs:5:20
    |
 LL |         Ok(opt) if let Some(4) = opt || false  => {}
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.rs
new file mode 100644
index 00000000000..530458064b2
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.rs
@@ -0,0 +1,14 @@
+// Regression test for #104172
+
+const N: usize = {
+    struct U;
+    !let y = 42;
+    //~^ ERROR expected expression, found `let` statement
+    3
+};
+
+struct S {
+    x: [(); N]
+}
+
+fn main() {}
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr
new file mode 100644
index 00000000000..3eaccde3b74
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/avoid-invalid-mir.stderr
@@ -0,0 +1,10 @@
+error: expected expression, found `let` statement
+  --> $DIR/avoid-invalid-mir.rs:5:6
+   |
+LL |     !let y = 42;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: aborting due to previous error
+
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.rs
new file mode 100644
index 00000000000..096036bb133
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.rs
@@ -0,0 +1,340 @@
+// Check that we don't suggest enabling a feature for code that's
+// not accepted even with that feature.
+
+#![allow(irrefutable_let_patterns)]
+
+use std::ops::Range;
+
+fn main() {}
+
+fn _if() {
+    if (let 0 = 1) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if (((let 0 = 1))) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if (let 0 = 1) && true {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if true && (let 0 = 1) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if (let 0 = 1) && (let 0 = 1) {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+
+    if (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+}
+
+fn _while() {
+    while (let 0 = 1) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while (((let 0 = 1))) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while (let 0 = 1) && true {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while true && (let 0 = 1) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while (let 0 = 1) && (let 0 = 1) {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+
+    while (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+}
+
+fn _macros() {
+    macro_rules! use_expr {
+        ($e:expr) => {
+            if $e {}
+            while $e {}
+        }
+    }
+    use_expr!((let 0 = 1 && 0 == 0));
+    //~^ ERROR expected expression, found `let` statement
+    use_expr!((let 0 = 1));
+    //~^ ERROR expected expression, found `let` statement
+}
+
+fn nested_within_if_expr() {
+    if &let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if !let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+    if *let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+    if -let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+
+    fn _check_try_binds_tighter() -> Result<(), ()> {
+        if let 0 = 0? {}
+        //~^ ERROR the `?` operator can only be applied to values that implement `Try`
+        Ok(())
+    }
+    if (let 0 = 0)? {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if true || let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+    if (true || let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    if true && (true || let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    if true || (true && let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    let mut x = true;
+    if x = let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+
+    if true..(let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+    if ..(let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    if (let 0 = 0).. {}
+    //~^ ERROR expected expression, found `let` statement
+
+    // Binds as `(let ... = true)..true &&/|| false`.
+    if let Range { start: _, end: _ } = true..true && false {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+    if let Range { start: _, end: _ } = true..true || false {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+
+    // Binds as `(let Range { start: F, end } = F)..(|| true)`.
+    const F: fn() -> bool = || true;
+    if let Range { start: F, end } = F..|| true {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+
+    // Binds as `(let Range { start: true, end } = t)..(&&false)`.
+    let t = &&true;
+    if let Range { start: true, end } = t..&&false {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+
+    if let true = let true = true {}
+    //~^ ERROR expected expression, found `let` statement
+}
+
+fn nested_within_while_expr() {
+    while &let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while !let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+    while *let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+    while -let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+
+    fn _check_try_binds_tighter() -> Result<(), ()> {
+        while let 0 = 0? {}
+        //~^ ERROR the `?` operator can only be applied to values that implement `Try`
+        Ok(())
+    }
+    while (let 0 = 0)? {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while true || let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+    while (true || let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    while true && (true || let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    while true || (true && let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+
+    let mut x = true;
+    while x = let 0 = 0 {}
+    //~^ ERROR expected expression, found `let` statement
+
+    while true..(let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+    while ..(let 0 = 0) {}
+    //~^ ERROR expected expression, found `let` statement
+    while (let 0 = 0).. {}
+    //~^ ERROR expected expression, found `let` statement
+
+    // Binds as `(let ... = true)..true &&/|| false`.
+    while let Range { start: _, end: _ } = true..true && false {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+    while let Range { start: _, end: _ } = true..true || false {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+
+    // Binds as `(let Range { start: F, end } = F)..(|| true)`.
+    const F: fn() -> bool = || true;
+    while let Range { start: F, end } = F..|| true {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+
+    // Binds as `(let Range { start: true, end } = t)..(&&false)`.
+    let t = &&true;
+    while let Range { start: true, end } = t..&&false {}
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR mismatched types
+
+    while let true = let true = true {}
+    //~^ ERROR expected expression, found `let` statement
+}
+
+fn not_error_because_clarified_intent() {
+    if let Range { start: _, end: _ } = (true..true || false) { }
+
+    if let Range { start: _, end: _ } = (true..true && false) { }
+
+    while let Range { start: _, end: _ } = (true..true || false) { }
+
+    while let Range { start: _, end: _ } = (true..true && false) { }
+}
+
+fn outside_if_and_while_expr() {
+    &let 0 = 0;
+    //~^ ERROR expected expression, found `let` statement
+
+    !let 0 = 0;
+    //~^ ERROR expected expression, found `let` statement
+    *let 0 = 0;
+    //~^ ERROR expected expression, found `let` statement
+    -let 0 = 0;
+    //~^ ERROR expected expression, found `let` statement
+    let _ = let _ = 3;
+    //~^ ERROR expected expression, found `let` statement
+
+    fn _check_try_binds_tighter() -> Result<(), ()> {
+        let 0 = 0?;
+        //~^ ERROR the `?` operator can only be applied to values that implement `Try`
+        Ok(())
+    }
+    (let 0 = 0)?;
+    //~^ ERROR expected expression, found `let` statement
+
+    true || let 0 = 0;
+    //~^ ERROR expected expression, found `let` statement
+    (true || let 0 = 0);
+    //~^ ERROR expected expression, found `let` statement
+    true && (true || let 0 = 0);
+    //~^ ERROR expected expression, found `let` statement
+
+    let mut x = true;
+    x = let 0 = 0;
+    //~^ ERROR expected expression, found `let` statement
+
+    true..(let 0 = 0);
+    //~^ ERROR expected expression, found `let` statement
+    ..(let 0 = 0);
+    //~^ ERROR expected expression, found `let` statement
+    (let 0 = 0)..;
+    //~^ ERROR expected expression, found `let` statement
+
+    (let Range { start: _, end: _ } = true..true || false);
+    //~^ ERROR mismatched types
+    //~| ERROR expected expression, found `let` statement
+
+    (let true = let true = true);
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+
+    {
+        #[cfg(FALSE)]
+        let x = true && let y = 1;
+        //~^ ERROR expected expression, found `let` statement
+    }
+
+    #[cfg(FALSE)]
+    {
+        [1, 2, 3][let _ = ()]
+        //~^ ERROR expected expression, found `let` statement
+    }
+
+    // Check function tail position.
+    &let 0 = 0
+    //~^ ERROR expected expression, found `let` statement
+}
+
+// Let's make sure that `let` inside const generic arguments are considered.
+fn inside_const_generic_arguments() {
+    struct A<const B: bool>;
+    impl<const B: bool> A<{B}> { const O: u32 = 5; }
+
+    if let A::<{
+        true && let 1 = 1
+        //~^ ERROR expected expression, found `let` statement
+    }>::O = 5 {}
+
+    while let A::<{
+        true && let 1 = 1
+        //~^ ERROR expected expression, found `let` statement
+    }>::O = 5 {}
+
+    if A::<{
+        true && let 1 = 1
+        //~^ ERROR expected expression, found `let` statement
+    }>::O == 5 {}
+
+    // In the cases above we have `ExprKind::Block` to help us out.
+    // Below however, we would not have a block and so an implementation might go
+    // from visiting expressions to types without banning `let` expressions down the tree.
+    // This tests ensures that we are not caught by surprise should the parser
+    // admit non-IDENT expressions in const generic arguments.
+
+    if A::<
+        true && let 1 = 1
+        //~^ ERROR expressions must be enclosed in braces
+        //~| ERROR expected expression, found `let` statement
+    >::O == 5 {}
+}
+
+fn with_parenthesis() {
+    let opt = Some(Some(1i32));
+
+    if (let Some(a) = opt && true) {
+    //~^ ERROR expected expression, found `let` statement
+    }
+
+    if (let Some(a) = opt) && true {
+    //~^ ERROR expected expression, found `let` statement
+    }
+    if (let Some(a) = opt) && (let Some(b) = a) {
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+    }
+
+    if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+    }
+    if (let Some(a) = opt && (let Some(b) = a)) && true {
+    //~^ ERROR expected expression, found `let` statement
+    //~| ERROR expected expression, found `let` statement
+    }
+    if (let Some(a) = opt && (true)) && true {
+    //~^ ERROR expected expression, found `let` statement
+    }
+
+    #[cfg(FALSE)]
+    let x = (true && let y = 1);
+    //~^ ERROR expected expression, found `let` statement
+
+    #[cfg(FALSE)]
+    {
+        ([1, 2, 3][let _ = ()])
+        //~^ ERROR expected expression, found `let` statement
+    }
+}
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.stderr
new file mode 100644
index 00000000000..31f389512ed
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions-without-feature-gate.stderr
@@ -0,0 +1,1021 @@
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:11:9
+   |
+LL |     if (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/disallowed-positions-without-feature-gate.rs:11:9
+   |
+LL |     if (let 0 = 1) {}
+   |         ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:14:11
+   |
+LL |     if (((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/disallowed-positions-without-feature-gate.rs:14:11
+   |
+LL |     if (((let 0 = 1))) {}
+   |           ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:17:9
+   |
+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/disallowed-positions-without-feature-gate.rs:17:9
+   |
+LL |     if (let 0 = 1) && true {}
+   |         ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:20:17
+   |
+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/disallowed-positions-without-feature-gate.rs:20:17
+   |
+LL |     if true && (let 0 = 1) {}
+   |                 ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:23:9
+   |
+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/disallowed-positions-without-feature-gate.rs:23:9
+   |
+LL |     if (let 0 = 1) && (let 0 = 1) {}
+   |         ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:23:24
+   |
+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/disallowed-positions-without-feature-gate.rs:23:24
+   |
+LL |     if (let 0 = 1) && (let 0 = 1) {}
+   |                        ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:27:9
+   |
+LL |     if (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/disallowed-positions-without-feature-gate.rs:27:9
+   |
+LL |     if (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:27:22
+   |
+LL |     if (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/disallowed-positions-without-feature-gate.rs:27:9
+   |
+LL |     if (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:27:35
+   |
+LL |     if (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/disallowed-positions-without-feature-gate.rs:27:9
+   |
+LL |     if (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:34:12
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:34:12
+   |
+LL |     while (let 0 = 1) {}
+   |            ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:37:14
+   |
+LL |     while (((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/disallowed-positions-without-feature-gate.rs:37:14
+   |
+LL |     while (((let 0 = 1))) {}
+   |              ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:40:12
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:40:12
+   |
+LL |     while (let 0 = 1) && true {}
+   |            ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:43:20
+   |
+LL |     while 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/disallowed-positions-without-feature-gate.rs:43:20
+   |
+LL |     while true && (let 0 = 1) {}
+   |                    ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:46:12
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:46:12
+   |
+LL |     while (let 0 = 1) && (let 0 = 1) {}
+   |            ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:46:27
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:46:27
+   |
+LL |     while (let 0 = 1) && (let 0 = 1) {}
+   |                           ^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:50:12
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:50:12
+   |
+LL |     while (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:50:25
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:50:12
+   |
+LL |     while (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:50:38
+   |
+LL |     while (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/disallowed-positions-without-feature-gate.rs:50:12
+   |
+LL |     while (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:70:9
+   |
+LL |     if &let 0 = 0 {}
+   |         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:73:9
+   |
+LL |     if !let 0 = 0 {}
+   |         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:75:9
+   |
+LL |     if *let 0 = 0 {}
+   |         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:77:9
+   |
+LL |     if -let 0 = 0 {}
+   |         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:85:9
+   |
+LL |     if (let 0 = 0)? {}
+   |         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:88:16
+   |
+LL |     if true || let 0 = 0 {}
+   |                ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+note: `||` operators are not supported in let chain expressions
+  --> $DIR/disallowed-positions-without-feature-gate.rs:88:13
+   |
+LL |     if true || let 0 = 0 {}
+   |             ^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:90:17
+   |
+LL |     if (true || let 0 = 0) {}
+   |                 ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:92:25
+   |
+LL |     if true && (true || let 0 = 0) {}
+   |                         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:94:25
+   |
+LL |     if true || (true && let 0 = 0) {}
+   |                         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:98:12
+   |
+LL |     if x = let 0 = 0 {}
+   |            ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:101:15
+   |
+LL |     if true..(let 0 = 0) {}
+   |               ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:104:11
+   |
+LL |     if ..(let 0 = 0) {}
+   |           ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:106:9
+   |
+LL |     if (let 0 = 0).. {}
+   |         ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:110:8
+   |
+LL |     if let Range { start: _, end: _ } = true..true && false {}
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:113:8
+   |
+LL |     if let Range { start: _, end: _ } = true..true || false {}
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:119:8
+   |
+LL |     if let Range { start: F, end } = F..|| true {}
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:125:8
+   |
+LL |     if let Range { start: true, end } = t..&&false {}
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:129:19
+   |
+LL |     if let true = let true = true {}
+   |                   ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:134:12
+   |
+LL |     while &let 0 = 0 {}
+   |            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:137:12
+   |
+LL |     while !let 0 = 0 {}
+   |            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:139:12
+   |
+LL |     while *let 0 = 0 {}
+   |            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:141:12
+   |
+LL |     while -let 0 = 0 {}
+   |            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:149:12
+   |
+LL |     while (let 0 = 0)? {}
+   |            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:152:19
+   |
+LL |     while true || let 0 = 0 {}
+   |                   ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+note: `||` operators are not supported in let chain expressions
+  --> $DIR/disallowed-positions-without-feature-gate.rs:152:16
+   |
+LL |     while true || let 0 = 0 {}
+   |                ^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:154:20
+   |
+LL |     while (true || let 0 = 0) {}
+   |                    ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:156:28
+   |
+LL |     while true && (true || let 0 = 0) {}
+   |                            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:158:28
+   |
+LL |     while true || (true && let 0 = 0) {}
+   |                            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:162:15
+   |
+LL |     while x = let 0 = 0 {}
+   |               ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:165:18
+   |
+LL |     while true..(let 0 = 0) {}
+   |                  ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:168:14
+   |
+LL |     while ..(let 0 = 0) {}
+   |              ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:170:12
+   |
+LL |     while (let 0 = 0).. {}
+   |            ^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:174:11
+   |
+LL |     while let Range { start: _, end: _ } = true..true && false {}
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:177:11
+   |
+LL |     while let Range { start: _, end: _ } = true..true || false {}
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:183:11
+   |
+LL |     while let Range { start: F, end } = F..|| true {}
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:189:11
+   |
+LL |     while let Range { start: true, end } = t..&&false {}
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:193:22
+   |
+LL |     while let true = let true = true {}
+   |                      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:208:6
+   |
+LL |     &let 0 = 0;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:211:6
+   |
+LL |     !let 0 = 0;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:213:6
+   |
+LL |     *let 0 = 0;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:215:6
+   |
+LL |     -let 0 = 0;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:217:13
+   |
+LL |     let _ = let _ = 3;
+   |             ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:225:6
+   |
+LL |     (let 0 = 0)?;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:228:13
+   |
+LL |     true || let 0 = 0;
+   |             ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:230:14
+   |
+LL |     (true || let 0 = 0);
+   |              ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:232:22
+   |
+LL |     true && (true || let 0 = 0);
+   |                      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:236:9
+   |
+LL |     x = let 0 = 0;
+   |         ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:239:12
+   |
+LL |     true..(let 0 = 0);
+   |            ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:241:8
+   |
+LL |     ..(let 0 = 0);
+   |        ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:243:6
+   |
+LL |     (let 0 = 0)..;
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:246:6
+   |
+LL |     (let Range { start: _, end: _ } = true..true || false);
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:250:6
+   |
+LL |     (let true = let true = true);
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:250:17
+   |
+LL |     (let true = let true = true);
+   |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:256:25
+   |
+LL |         let x = true && let y = 1;
+   |                         ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:262:19
+   |
+LL |         [1, 2, 3][let _ = ()]
+   |                   ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:267:6
+   |
+LL |     &let 0 = 0
+   |      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:277:17
+   |
+LL |         true && let 1 = 1
+   |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:282:17
+   |
+LL |         true && let 1 = 1
+   |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:287:17
+   |
+LL |         true && let 1 = 1
+   |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:298:17
+   |
+LL |         true && let 1 = 1
+   |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expressions must be enclosed in braces to be used as const generic arguments
+  --> $DIR/disallowed-positions-without-feature-gate.rs:298:9
+   |
+LL |         true && let 1 = 1
+   |         ^^^^^^^^^^^^^^^^^
+   |
+help: enclose the `const` expression in braces
+   |
+LL |         { true && let 1 = 1 }
+   |         +                   +
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:307:9
+   |
+LL |     if (let Some(a) = opt && 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/disallowed-positions-without-feature-gate.rs:307:9
+   |
+LL |     if (let Some(a) = opt && true) {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:311:9
+   |
+LL |     if (let Some(a) = opt) && 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/disallowed-positions-without-feature-gate.rs:311:9
+   |
+LL |     if (let Some(a) = opt) && true {
+   |         ^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:314:9
+   |
+LL |     if (let Some(a) = opt) && (let Some(b) = a) {
+   |         ^^^^^^^^^^^^^^^^^
+   |
+   = 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/disallowed-positions-without-feature-gate.rs:314:9
+   |
+LL |     if (let Some(a) = opt) && (let Some(b) = a) {
+   |         ^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:314:32
+   |
+LL |     if (let Some(a) = opt) && (let Some(b) = a) {
+   |                                ^^^^^^^^^^^^^^^
+   |
+   = 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/disallowed-positions-without-feature-gate.rs:314:32
+   |
+LL |     if (let Some(a) = opt) && (let Some(b) = a) {
+   |                                ^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:319:9
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 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/disallowed-positions-without-feature-gate.rs:319:9
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:319:31
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 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/disallowed-positions-without-feature-gate.rs:319:31
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
+   |                               ^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:323:9
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && 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/disallowed-positions-without-feature-gate.rs:323:9
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && true {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:323:31
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && 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/disallowed-positions-without-feature-gate.rs:323:31
+   |
+LL |     if (let Some(a) = opt && (let Some(b) = a)) && true {
+   |                               ^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:327:9
+   |
+LL |     if (let Some(a) = opt && (true)) && 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/disallowed-positions-without-feature-gate.rs:327:9
+   |
+LL |     if (let Some(a) = opt && (true)) && true {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:332:22
+   |
+LL |     let x = (true && let y = 1);
+   |                      ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:337:20
+   |
+LL |         ([1, 2, 3][let _ = ()])
+   |                    ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions-without-feature-gate.rs:63:16
+   |
+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/disallowed-positions-without-feature-gate.rs:65:16
+   |
+LL |     use_expr!((let 0 = 1));
+   |                ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:101:8
+   |
+LL |     if true..(let 0 = 0) {}
+   |        ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<bool>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:110:12
+   |
+LL |     if let Range { start: _, end: _ } = true..true && false {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
+   |            |
+   |            expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:113:12
+   |
+LL |     if let Range { start: _, end: _ } = true..true || false {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
+   |            |
+   |            expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:119:12
+   |
+LL |     if let Range { start: F, end } = F..|| true {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `fn() -> bool`
+   |            |
+   |            expected fn pointer, found `Range<_>`
+   |
+   = note: expected fn pointer `fn() -> bool`
+                  found struct `std::ops::Range<_>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:125:12
+   |
+LL |     if let Range { start: true, end } = t..&&false {}
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
+   |            |
+   |            expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/disallowed-positions-without-feature-gate.rs:81:20
+   |
+LL |         if let 0 = 0? {}
+   |                    ^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:165:11
+   |
+LL |     while true..(let 0 = 0) {}
+   |           ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<bool>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:174:15
+   |
+LL |     while let Range { start: _, end: _ } = true..true && false {}
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
+   |               |
+   |               expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:177:15
+   |
+LL |     while let Range { start: _, end: _ } = true..true || false {}
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
+   |               |
+   |               expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:183:15
+   |
+LL |     while let Range { start: F, end } = F..|| true {}
+   |               ^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `fn() -> bool`
+   |               |
+   |               expected fn pointer, found `Range<_>`
+   |
+   = note: expected fn pointer `fn() -> bool`
+                  found struct `std::ops::Range<_>`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:189:15
+   |
+LL |     while let Range { start: true, end } = t..&&false {}
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
+   |               |
+   |               expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/disallowed-positions-without-feature-gate.rs:145:23
+   |
+LL |         while let 0 = 0? {}
+   |                       ^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error[E0308]: mismatched types
+  --> $DIR/disallowed-positions-without-feature-gate.rs:246:10
+   |
+LL |     (let Range { start: _, end: _ } = true..true || false);
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
+   |          |
+   |          expected `bool`, found `Range<_>`
+   |
+   = note: expected type `bool`
+            found struct `std::ops::Range<_>`
+
+error[E0277]: the `?` operator can only be applied to values that implement `Try`
+  --> $DIR/disallowed-positions-without-feature-gate.rs:221:17
+   |
+LL |         let 0 = 0?;
+   |                 ^^ the `?` operator cannot be applied to type `{integer}`
+   |
+   = help: the trait `Try` is not implemented for `{integer}`
+
+error: aborting due to 105 previous errors
+
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs
index 2a9a5472b2e..4ac3ea53a08 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs
@@ -27,64 +27,46 @@ fn main() {}
 
 fn _if() {
     if (let 0 = 1) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if (((let 0 = 1))) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if (let 0 = 1) && true {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if true && (let 0 = 1) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if (let 0 = 1) && (let 0 = 1) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
 
     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
 }
 
 fn _while() {
     while (let 0 = 1) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while (((let 0 = 1))) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while (let 0 = 1) && true {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while true && (let 0 = 1) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while (let 0 = 1) && (let 0 = 1) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
 
     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
 }
@@ -97,32 +79,21 @@ fn _macros() {
         }
     }
     use_expr!((let 0 = 1 && 0 == 0));
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     use_expr!((let 0 = 1));
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 }
 
 fn nested_within_if_expr() {
     if &let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if !let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     if *let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR type `bool` cannot be dereferenced
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     if -let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR cannot apply unary operator `-` to type `bool`
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     fn _check_try_binds_tighter() -> Result<(), ()> {
         if let 0 = 0? {}
@@ -130,91 +101,63 @@ fn nested_within_if_expr() {
         Ok(())
     }
     if (let 0 = 0)? {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR the `?` operator can only be applied to values that implement `Try`
-    //~| ERROR the `?` operator can only be used in a function that returns `Result`
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if true || let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     if (true || let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     if true && (true || let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     if true || (true && let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     let mut x = true;
     if x = let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     if true..(let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
     if ..(let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     if (let 0 = 0).. {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     // Binds as `(let ... = true)..true &&/|| false`.
     if let Range { start: _, end: _ } = true..true && false {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
     if let Range { start: _, end: _ } = true..true || false {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
 
     // Binds as `(let Range { start: F, end } = F)..(|| true)`.
     const F: fn() -> bool = || true;
     if let Range { start: F, end } = F..|| true {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
 
     // Binds as `(let Range { start: true, end } = t)..(&&false)`.
     let t = &&true;
     if let Range { start: true, end } = t..&&false {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
 
     if let true = let true = true {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 }
 
 fn nested_within_while_expr() {
     while &let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while !let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     while *let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR type `bool` cannot be dereferenced
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     while -let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR cannot apply unary operator `-` to type `bool`
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     fn _check_try_binds_tighter() -> Result<(), ()> {
         while let 0 = 0? {}
@@ -222,72 +165,51 @@ fn nested_within_while_expr() {
         Ok(())
     }
     while (let 0 = 0)? {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR the `?` operator can only be applied to values that implement `Try`
-    //~| ERROR the `?` operator can only be used in a function that returns `Result`
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while true || let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     while (true || let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     while true && (true || let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     while true || (true && let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     let mut x = true;
     while x = let 0 = 0 {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     while true..(let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
     while ..(let 0 = 0) {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     while (let 0 = 0).. {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     // Binds as `(let ... = true)..true &&/|| false`.
     while let Range { start: _, end: _ } = true..true && false {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
     while let Range { start: _, end: _ } = true..true || false {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
 
     // Binds as `(let Range { start: F, end } = F)..(|| true)`.
     const F: fn() -> bool = || true;
     while let Range { start: F, end } = F..|| true {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
 
     // Binds as `(let Range { start: true, end } = t)..(&&false)`.
     let t = &&true;
     while let Range { start: true, end } = t..&&false {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR mismatched types
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR mismatched types
 
     while let true = let true = true {}
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 }
 
 fn not_error_because_clarified_intent() {
@@ -302,20 +224,14 @@ fn not_error_because_clarified_intent() {
 
 fn outside_if_and_while_expr() {
     &let 0 = 0;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     !let 0 = 0;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     *let 0 = 0;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR type `bool` cannot be dereferenced
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     -let 0 = 0;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR cannot apply unary operator `-` to type `bool`
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     fn _check_try_binds_tighter() -> Result<(), ()> {
         let 0 = 0?;
@@ -323,44 +239,32 @@ fn outside_if_and_while_expr() {
         Ok(())
     }
     (let 0 = 0)?;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR the `?` operator can only be used in a function that returns `Result`
-    //~| ERROR the `?` operator can only be applied to values that implement `Try`
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     true || let 0 = 0;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     (true || let 0 = 0);
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     true && (true || let 0 = 0);
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     let mut x = true;
     x = let 0 = 0;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     true..(let 0 = 0);
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     ..(let 0 = 0);
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     (let 0 = 0)..;
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     (let Range { start: _, end: _ } = true..true || false);
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
+    //~^ ERROR mismatched types
     //~| ERROR expected expression, found `let` statement
 
     (let true = let true = true);
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
 
     {
@@ -377,9 +281,7 @@ fn outside_if_and_while_expr() {
 
     // Check function tail position.
     &let 0 = 0
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR mismatched types
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 }
 
 // Let's make sure that `let` inside const generic arguments are considered.
@@ -389,20 +291,17 @@ fn inside_const_generic_arguments() {
 
     if let A::<{
         true && let 1 = 1
-        //~^ ERROR `let` expressions are not supported here
-        //~| ERROR expected expression, found `let` statement
+        //~^ ERROR expected expression, found `let` statement
     }>::O = 5 {}
 
     while let A::<{
         true && let 1 = 1
-        //~^ ERROR `let` expressions are not supported here
-        //~| ERROR expected expression, found `let` statement
+        //~^ ERROR expected expression, found `let` statement
     }>::O = 5 {}
 
     if A::<{
         true && let 1 = 1
-        //~^ ERROR `let` expressions are not supported here
-        //~| ERROR expected expression, found `let` statement
+        //~^ ERROR expected expression, found `let` statement
     }>::O == 5 {}
 
     // In the cases above we have `ExprKind::Block` to help us out.
@@ -413,8 +312,7 @@ fn inside_const_generic_arguments() {
 
     if A::<
         true && let 1 = 1
-        //~^ ERROR `let` expressions are not supported here
-        //~| ERROR expressions must be enclosed in braces
+        //~^ ERROR expressions must be enclosed in braces
         //~| ERROR expected expression, found `let` statement
     >::O == 5 {}
 }
@@ -423,38 +321,29 @@ fn with_parenthesis() {
     let opt = Some(Some(1i32));
 
     if (let Some(a) = opt && true) {
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     }
 
     if (let Some(a) = opt) && true {
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     }
     if (let Some(a) = opt) && (let Some(b) = a) {
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
     }
     if let Some(a) = opt && (true && true) {
     }
 
     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
     }
     if (let Some(a) = opt && (let Some(b) = a)) && true {
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     //~| ERROR expected expression, found `let` statement
     }
     if (let Some(a) = opt && (true)) && true {
-    //~^ ERROR `let` expressions are not supported here
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     }
 
     if (true && (true)) && let Some(a) = opt {
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr
index 81933173c25..ab58abf4d46 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr
@@ -2,503 +2,6 @@ error: expected expression, found `let` statement
   --> $DIR/disallowed-positions.rs:29:9
    |
 LL |     if (let 0 = 1) {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:33:11
-   |
-LL |     if (((let 0 = 1))) {}
-   |           ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:37:9
-   |
-LL |     if (let 0 = 1) && true {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:41:17
-   |
-LL |     if true && (let 0 = 1) {}
-   |                 ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:45:9
-   |
-LL |     if (let 0 = 1) && (let 0 = 1) {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:45:24
-   |
-LL |     if (let 0 = 1) && (let 0 = 1) {}
-   |                        ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:51:35
-   |
-LL |     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-   |                                   ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:51:48
-   |
-LL |     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-   |                                                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:51:61
-   |
-LL |     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-   |                                                             ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:61:12
-   |
-LL |     while (let 0 = 1) {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:65:14
-   |
-LL |     while (((let 0 = 1))) {}
-   |              ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:69:12
-   |
-LL |     while (let 0 = 1) && true {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:73:20
-   |
-LL |     while true && (let 0 = 1) {}
-   |                    ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:77:12
-   |
-LL |     while (let 0 = 1) && (let 0 = 1) {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:77:27
-   |
-LL |     while (let 0 = 1) && (let 0 = 1) {}
-   |                           ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:83:38
-   |
-LL |     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-   |                                      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:83:51
-   |
-LL |     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-   |                                                   ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:83:64
-   |
-LL |     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
-   |                                                                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:110:9
-   |
-LL |     if &let 0 = 0 {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:115:9
-   |
-LL |     if !let 0 = 0 {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:118:9
-   |
-LL |     if *let 0 = 0 {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:122:9
-   |
-LL |     if -let 0 = 0 {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:132:9
-   |
-LL |     if (let 0 = 0)? {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:138:16
-   |
-LL |     if true || let 0 = 0 {}
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:141:17
-   |
-LL |     if (true || let 0 = 0) {}
-   |                 ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:144:25
-   |
-LL |     if true && (true || let 0 = 0) {}
-   |                         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:147:25
-   |
-LL |     if true || (true && let 0 = 0) {}
-   |                         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:152:12
-   |
-LL |     if x = let 0 = 0 {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:157:15
-   |
-LL |     if true..(let 0 = 0) {}
-   |               ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:161:11
-   |
-LL |     if ..(let 0 = 0) {}
-   |           ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:165:9
-   |
-LL |     if (let 0 = 0).. {}
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:196:19
-   |
-LL |     if let true = let true = true {}
-   |                   ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:202:12
-   |
-LL |     while &let 0 = 0 {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:207:12
-   |
-LL |     while !let 0 = 0 {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:210:12
-   |
-LL |     while *let 0 = 0 {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:214:12
-   |
-LL |     while -let 0 = 0 {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:224:12
-   |
-LL |     while (let 0 = 0)? {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:230:19
-   |
-LL |     while true || let 0 = 0 {}
-   |                   ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:233:20
-   |
-LL |     while (true || let 0 = 0) {}
-   |                    ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:236:28
-   |
-LL |     while true && (true || let 0 = 0) {}
-   |                            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:239:28
-   |
-LL |     while true || (true && let 0 = 0) {}
-   |                            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:244:15
-   |
-LL |     while x = let 0 = 0 {}
-   |               ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:249:18
-   |
-LL |     while true..(let 0 = 0) {}
-   |                  ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:253:14
-   |
-LL |     while ..(let 0 = 0) {}
-   |              ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:257:12
-   |
-LL |     while (let 0 = 0).. {}
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:288:22
-   |
-LL |     while let true = let true = true {}
-   |                      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:304:6
-   |
-LL |     &let 0 = 0;
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:308:6
-   |
-LL |     !let 0 = 0;
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:311:6
-   |
-LL |     *let 0 = 0;
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:315:6
-   |
-LL |     -let 0 = 0;
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:325:6
-   |
-LL |     (let 0 = 0)?;
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:331:13
-   |
-LL |     true || let 0 = 0;
-   |             ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:334:14
-   |
-LL |     (true || let 0 = 0);
-   |              ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:337:22
-   |
-LL |     true && (true || let 0 = 0);
-   |                      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:342:9
-   |
-LL |     x = let 0 = 0;
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:346:12
-   |
-LL |     true..(let 0 = 0);
-   |            ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:349:8
-   |
-LL |     ..(let 0 = 0);
-   |        ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:352:6
-   |
-LL |     (let 0 = 0)..;
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:356:6
-   |
-LL |     (let Range { start: _, end: _ } = true..true || false);
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:361:6
-   |
-LL |     (let true = let true = true);
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:361:17
-   |
-LL |     (let true = let true = true);
-   |                 ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:368:25
-   |
-LL |         let x = true && let y = 1;
-   |                         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:374:19
-   |
-LL |         [1, 2, 3][let _ = ()]
-   |                   ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:379:6
-   |
-LL |     &let 0 = 0
-   |      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:391:17
-   |
-LL |         true && let 1 = 1
-   |                 ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:397:17
-   |
-LL |         true && let 1 = 1
-   |                 ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:403:17
-   |
-LL |         true && let 1 = 1
-   |                 ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:415:17
-   |
-LL |         true && let 1 = 1
-   |                 ^^^
-
-error: expressions must be enclosed in braces to be used as const generic arguments
-  --> $DIR/disallowed-positions.rs:415:9
-   |
-LL |         true && let 1 = 1
-   |         ^^^^^^^^^^^^^^^^^
-   |
-help: enclose the `const` expression in braces
-   |
-LL |         { true && let 1 = 1 }
-   |         +                   +
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:425:9
-   |
-LL |     if (let Some(a) = opt && true) {
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:430:9
-   |
-LL |     if (let Some(a) = opt) && true {
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:434:9
-   |
-LL |     if (let Some(a) = opt) && (let Some(b) = a) {
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:434:32
-   |
-LL |     if (let Some(a) = opt) && (let Some(b) = a) {
-   |                                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:443:9
-   |
-LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:443:31
-   |
-LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
-   |                               ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:449:9
-   |
-LL |     if (let Some(a) = opt && (let Some(b) = a)) && true {
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:449:31
-   |
-LL |     if (let Some(a) = opt && (let Some(b) = a)) && true {
-   |                               ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:455:9
-   |
-LL |     if (let Some(a) = opt && (true)) && true {
-   |         ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:472:22
-   |
-LL |     let x = (true && let y = 1);
-   |                      ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:477:20
-   |
-LL |         ([1, 2, 3][let _ = ()])
-   |                    ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:99:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^
-
-error: expected expression, found `let` statement
-  --> $DIR/disallowed-positions.rs:103:16
-   |
-LL |     use_expr!((let 0 = 1));
-   |                ^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:29:9
-   |
-LL |     if (let 0 = 1) {}
    |         ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
@@ -508,1012 +11,863 @@ note: `let`s wrapped in parentheses are not supported in a context with let chai
 LL |     if (let 0 = 1) {}
    |         ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:33:11
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:32:11
    |
 LL |     if (((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/disallowed-positions.rs:33:11
+  --> $DIR/disallowed-positions.rs:32:11
    |
 LL |     if (((let 0 = 1))) {}
    |           ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:37:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:35:9
    |
 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/disallowed-positions.rs:37:9
+  --> $DIR/disallowed-positions.rs:35:9
    |
 LL |     if (let 0 = 1) && true {}
    |         ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:41:17
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:38:17
    |
 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/disallowed-positions.rs:41:17
+  --> $DIR/disallowed-positions.rs:38:17
    |
 LL |     if true && (let 0 = 1) {}
    |                 ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:45:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:41:9
    |
 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/disallowed-positions.rs:45:9
+  --> $DIR/disallowed-positions.rs:41:9
    |
 LL |     if (let 0 = 1) && (let 0 = 1) {}
    |         ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:45:24
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:41:24
    |
 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/disallowed-positions.rs:45:24
+  --> $DIR/disallowed-positions.rs:41:24
    |
 LL |     if (let 0 = 1) && (let 0 = 1) {}
    |                        ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:51:35
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:45:35
    |
 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/disallowed-positions.rs:51:35
+  --> $DIR/disallowed-positions.rs:45:35
    |
 LL |     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:51:48
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:45:48
    |
 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/disallowed-positions.rs:51:35
+  --> $DIR/disallowed-positions.rs:45:35
    |
 LL |     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:51:61
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:45:61
    |
 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/disallowed-positions.rs:51:35
+  --> $DIR/disallowed-positions.rs:45:35
    |
 LL |     if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:61:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:52:12
    |
 LL |     while (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/disallowed-positions.rs:61:12
+  --> $DIR/disallowed-positions.rs:52:12
    |
 LL |     while (let 0 = 1) {}
    |            ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:65:14
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:55:14
    |
 LL |     while (((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/disallowed-positions.rs:65:14
+  --> $DIR/disallowed-positions.rs:55:14
    |
 LL |     while (((let 0 = 1))) {}
    |              ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:69:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:58:12
    |
 LL |     while (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/disallowed-positions.rs:69:12
+  --> $DIR/disallowed-positions.rs:58:12
    |
 LL |     while (let 0 = 1) && true {}
    |            ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:73:20
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:61:20
    |
 LL |     while 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/disallowed-positions.rs:73:20
+  --> $DIR/disallowed-positions.rs:61:20
    |
 LL |     while true && (let 0 = 1) {}
    |                    ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:77:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:64:12
    |
 LL |     while (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/disallowed-positions.rs:77:12
+  --> $DIR/disallowed-positions.rs:64:12
    |
 LL |     while (let 0 = 1) && (let 0 = 1) {}
    |            ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:77:27
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:64:27
    |
 LL |     while (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/disallowed-positions.rs:77:27
+  --> $DIR/disallowed-positions.rs:64:27
    |
 LL |     while (let 0 = 1) && (let 0 = 1) {}
    |                           ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:83:38
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:68:38
    |
 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: `let`s wrapped in parentheses are not supported in a context with let chains
-  --> $DIR/disallowed-positions.rs:83:38
+  --> $DIR/disallowed-positions.rs:68:38
    |
 LL |     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:83:51
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:68:51
    |
 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: `let`s wrapped in parentheses are not supported in a context with let chains
-  --> $DIR/disallowed-positions.rs:83:38
+  --> $DIR/disallowed-positions.rs:68:38
    |
 LL |     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:83:64
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:68:64
    |
 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: `let`s wrapped in parentheses are not supported in a context with let chains
-  --> $DIR/disallowed-positions.rs:83:38
+  --> $DIR/disallowed-positions.rs:68:38
    |
 LL |     while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:99:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^^^^^^^
-   |
-   = 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/disallowed-positions.rs:99:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^^^^^^^^^^^^^^^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:99:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^^^^^^^
-   |
-   = 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/disallowed-positions.rs:99:16
-   |
-LL |     use_expr!((let 0 = 1 && 0 == 0));
-   |                ^^^^^^^^^^^^^^^^^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:103:16
-   |
-LL |     use_expr!((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/disallowed-positions.rs:103:16
-   |
-LL |     use_expr!((let 0 = 1));
-   |                ^^^^^^^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:103:16
-   |
-LL |     use_expr!((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/disallowed-positions.rs:103:16
-   |
-LL |     use_expr!((let 0 = 1));
-   |                ^^^^^^^^^
-
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:110:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:88:9
    |
 LL |     if &let 0 = 0 {}
    |         ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:115:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:91:9
    |
 LL |     if !let 0 = 0 {}
    |         ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:118:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:93:9
    |
 LL |     if *let 0 = 0 {}
    |         ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:122:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:95:9
    |
 LL |     if -let 0 = 0 {}
    |         ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:132:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:103:9
    |
 LL |     if (let 0 = 0)? {}
    |         ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:132:9
-   |
-LL |     if (let 0 = 0)? {}
-   |         ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:138:16
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:106:16
    |
 LL |     if true || let 0 = 0 {}
    |                ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:138:13
+  --> $DIR/disallowed-positions.rs:106:13
    |
 LL |     if true || let 0 = 0 {}
    |             ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:141:17
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:108:17
    |
 LL |     if (true || let 0 = 0) {}
    |                 ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:141:14
-   |
-LL |     if (true || let 0 = 0) {}
-   |              ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:144:25
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:110:25
    |
 LL |     if true && (true || let 0 = 0) {}
    |                         ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:144:22
-   |
-LL |     if true && (true || let 0 = 0) {}
-   |                      ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:147:25
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:112:25
    |
 LL |     if true || (true && let 0 = 0) {}
    |                         ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:147:17
-   |
-LL |     if true || (true && let 0 = 0) {}
-   |                 ^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:152:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:116:12
    |
 LL |     if x = let 0 = 0 {}
-   |            ^^^^^^^^^
+   |            ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:157:15
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:119:15
    |
 LL |     if true..(let 0 = 0) {}
    |               ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:157:15
-   |
-LL |     if true..(let 0 = 0) {}
-   |               ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:161:11
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:122:11
    |
 LL |     if ..(let 0 = 0) {}
    |           ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:161:11
-   |
-LL |     if ..(let 0 = 0) {}
-   |           ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:165:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:124:9
    |
 LL |     if (let 0 = 0).. {}
    |         ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:165:9
-   |
-LL |     if (let 0 = 0).. {}
-   |         ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:171:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:128:8
    |
 LL |     if let Range { start: _, end: _ } = true..true && false {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:175:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:131:8
    |
 LL |     if let Range { start: _, end: _ } = true..true || false {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:182:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:137:8
    |
 LL |     if let Range { start: F, end } = F..|| true {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:190:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:143:8
    |
 LL |     if let Range { start: true, end } = t..&&false {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:196:19
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:147:19
    |
 LL |     if let true = let true = true {}
-   |                   ^^^^^^^^^^^^^^^
+   |                   ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:202:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:152:12
    |
 LL |     while &let 0 = 0 {}
    |            ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:207:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:155:12
    |
 LL |     while !let 0 = 0 {}
    |            ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:210:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:157:12
    |
 LL |     while *let 0 = 0 {}
    |            ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:214:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:159:12
    |
 LL |     while -let 0 = 0 {}
    |            ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:224:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:167:12
    |
 LL |     while (let 0 = 0)? {}
    |            ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:224:12
-   |
-LL |     while (let 0 = 0)? {}
-   |            ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:230:19
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:170:19
    |
 LL |     while true || let 0 = 0 {}
    |                   ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:230:16
+  --> $DIR/disallowed-positions.rs:170:16
    |
 LL |     while true || let 0 = 0 {}
    |                ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:233:20
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:172:20
    |
 LL |     while (true || let 0 = 0) {}
    |                    ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:233:17
-   |
-LL |     while (true || let 0 = 0) {}
-   |                 ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:236:28
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:174:28
    |
 LL |     while true && (true || let 0 = 0) {}
    |                            ^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:236:25
-   |
-LL |     while true && (true || let 0 = 0) {}
-   |                         ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:239:28
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:176:28
    |
 LL |     while true || (true && let 0 = 0) {}
    |                            ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:239:20
-   |
-LL |     while true || (true && let 0 = 0) {}
-   |                    ^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:244:15
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:180:15
    |
 LL |     while x = let 0 = 0 {}
-   |               ^^^^^^^^^
+   |               ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:249:18
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:183:18
    |
 LL |     while true..(let 0 = 0) {}
    |                  ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:249:18
-   |
-LL |     while true..(let 0 = 0) {}
-   |                  ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:253:14
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:186:14
    |
 LL |     while ..(let 0 = 0) {}
    |              ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:253:14
-   |
-LL |     while ..(let 0 = 0) {}
-   |              ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:257:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:188:12
    |
 LL |     while (let 0 = 0).. {}
    |            ^^^^^^^^^
    |
    = 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/disallowed-positions.rs:257:12
-   |
-LL |     while (let 0 = 0).. {}
-   |            ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:263:11
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:192:11
    |
 LL |     while let Range { start: _, end: _ } = true..true && false {}
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:267:11
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:195:11
    |
 LL |     while let Range { start: _, end: _ } = true..true || false {}
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:274:11
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:201:11
    |
 LL |     while let Range { start: F, end } = F..|| true {}
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:282:11
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:207:11
    |
 LL |     while let Range { start: true, end } = t..&&false {}
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:288:22
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:211:22
    |
 LL |     while let true = let true = true {}
-   |                      ^^^^^^^^^^^^^^^
+   |                      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:304:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:226:6
    |
 LL |     &let 0 = 0;
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:308:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:229:6
    |
 LL |     !let 0 = 0;
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:311:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:231:6
    |
 LL |     *let 0 = 0;
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:315:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:233:6
    |
 LL |     -let 0 = 0;
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:325:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:241:6
    |
 LL |     (let 0 = 0)?;
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = 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/disallowed-positions.rs:325:6
-   |
-LL |     (let 0 = 0)?;
-   |      ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:331:13
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:244:13
    |
 LL |     true || let 0 = 0;
-   |             ^^^^^^^^^
+   |             ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:331:10
-   |
-LL |     true || let 0 = 0;
-   |          ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:334:14
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:246:14
    |
 LL |     (true || let 0 = 0);
-   |              ^^^^^^^^^
+   |              ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:334:11
-   |
-LL |     (true || let 0 = 0);
-   |           ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:337:22
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:248:22
    |
 LL |     true && (true || let 0 = 0);
-   |                      ^^^^^^^^^
+   |                      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
-note: `||` operators are not supported in let chain expressions
-  --> $DIR/disallowed-positions.rs:337:19
-   |
-LL |     true && (true || let 0 = 0);
-   |                   ^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:342:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:252:9
    |
 LL |     x = let 0 = 0;
-   |         ^^^^^^^^^
+   |         ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:346:12
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:255:12
    |
 LL |     true..(let 0 = 0);
-   |            ^^^^^^^^^
+   |            ^^^
    |
    = 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/disallowed-positions.rs:346:12
-   |
-LL |     true..(let 0 = 0);
-   |            ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:349:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:257:8
    |
 LL |     ..(let 0 = 0);
-   |        ^^^^^^^^^
+   |        ^^^
    |
    = 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/disallowed-positions.rs:349:8
-   |
-LL |     ..(let 0 = 0);
-   |        ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:352:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:259:6
    |
 LL |     (let 0 = 0)..;
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = 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/disallowed-positions.rs:352:6
-   |
-LL |     (let 0 = 0)..;
-   |      ^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:356:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:262:6
    |
 LL |     (let Range { start: _, end: _ } = true..true || false);
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:361:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:266:6
    |
 LL |     (let true = let true = 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/disallowed-positions.rs:361:6
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:266:17
    |
 LL |     (let true = let true = true);
-   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:272:25
+   |
+LL |         let x = true && let y = 1;
+   |                         ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:278:19
+   |
+LL |         [1, 2, 3][let _ = ()]
+   |                   ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:379:6
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:283:6
    |
 LL |     &let 0 = 0
-   |      ^^^^^^^^^
+   |      ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:391:17
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:293:17
    |
 LL |         true && let 1 = 1
-   |                 ^^^^^^^^^
+   |                 ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:397:17
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:298:17
    |
 LL |         true && let 1 = 1
-   |                 ^^^^^^^^^
+   |                 ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:403:17
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:303:17
    |
 LL |         true && let 1 = 1
-   |                 ^^^^^^^^^
+   |                 ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:415:17
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:314:17
    |
 LL |         true && let 1 = 1
-   |                 ^^^^^^^^^
+   |                 ^^^
    |
    = note: only supported directly in conditions of `if` and `while` expressions
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:425:9
+error: expressions must be enclosed in braces to be used as const generic arguments
+  --> $DIR/disallowed-positions.rs:314:9
+   |
+LL |         true && let 1 = 1
+   |         ^^^^^^^^^^^^^^^^^
+   |
+help: enclose the `const` expression in braces
+   |
+LL |         { true && let 1 = 1 }
+   |         +                   +
+
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:323:9
    |
 LL |     if (let Some(a) = opt && 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/disallowed-positions.rs:425:9
+  --> $DIR/disallowed-positions.rs:323:9
    |
 LL |     if (let Some(a) = opt && true) {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:430:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:327:9
    |
 LL |     if (let Some(a) = opt) && 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/disallowed-positions.rs:430:9
+  --> $DIR/disallowed-positions.rs:327:9
    |
 LL |     if (let Some(a) = opt) && true {
    |         ^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:434:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:330:9
    |
 LL |     if (let Some(a) = opt) && (let Some(b) = a) {
    |         ^^^^^^^^^^^^^^^^^
    |
    = 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/disallowed-positions.rs:434:9
+  --> $DIR/disallowed-positions.rs:330:9
    |
 LL |     if (let Some(a) = opt) && (let Some(b) = a) {
    |         ^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:434:32
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:330:32
    |
 LL |     if (let Some(a) = opt) && (let Some(b) = a) {
    |                                ^^^^^^^^^^^^^^^
    |
    = 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/disallowed-positions.rs:434:32
+  --> $DIR/disallowed-positions.rs:330:32
    |
 LL |     if (let Some(a) = opt) && (let Some(b) = a) {
    |                                ^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:443:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:337:9
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 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/disallowed-positions.rs:443:9
+  --> $DIR/disallowed-positions.rs:337:9
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:443:31
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:337:31
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 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/disallowed-positions.rs:443:31
+  --> $DIR/disallowed-positions.rs:337:31
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
    |                               ^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:449:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:341:9
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && 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/disallowed-positions.rs:449:9
+  --> $DIR/disallowed-positions.rs:341:9
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && true {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:449:31
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:341:31
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && 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/disallowed-positions.rs:449:31
+  --> $DIR/disallowed-positions.rs:341:31
    |
 LL |     if (let Some(a) = opt && (let Some(b) = a)) && true {
    |                               ^^^^^^^^^^^^^^^
 
-error: `let` expressions are not supported here
-  --> $DIR/disallowed-positions.rs:455:9
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:345:9
    |
 LL |     if (let Some(a) = opt && (true)) && 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/disallowed-positions.rs:455:9
+  --> $DIR/disallowed-positions.rs:345:9
    |
 LL |     if (let Some(a) = opt && (true)) && true {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:110:8
-   |
-LL |     if &let 0 = 0 {}
-   |        ^^^^^^^^^^ expected `bool`, found `&bool`
-   |
-help: consider removing the borrow
-   |
-LL -     if &let 0 = 0 {}
-LL +     if let 0 = 0 {}
-   |
-
-error[E0614]: type `bool` cannot be dereferenced
-  --> $DIR/disallowed-positions.rs:118:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:361:22
    |
-LL |     if *let 0 = 0 {}
-   |        ^^^^^^^^^^
-
-error[E0600]: cannot apply unary operator `-` to type `bool`
-  --> $DIR/disallowed-positions.rs:122:8
+LL |     let x = (true && let y = 1);
+   |                      ^^^
    |
-LL |     if -let 0 = 0 {}
-   |        ^^^^^^^^^^ cannot apply unary operator `-`
+   = note: only supported directly in conditions of `if` and `while` expressions
 
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
-  --> $DIR/disallowed-positions.rs:132:8
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:366:20
    |
-LL |     if (let 0 = 0)? {}
-   |        ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
+LL |         ([1, 2, 3][let _ = ()])
+   |                    ^^^
    |
-   = help: the trait `Try` is not implemented for `bool`
+   = note: only supported directly in conditions of `if` and `while` expressions
 
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
-  --> $DIR/disallowed-positions.rs:132:19
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:81:16
    |
-LL | fn nested_within_if_expr() {
-   | -------------------------- this function should return `Result` or `Option` to accept `?`
-...
-LL |     if (let 0 = 0)? {}
-   |                   ^ cannot use the `?` operator in a function that returns `()`
+LL |     use_expr!((let 0 = 1 && 0 == 0));
+   |                ^^^
    |
-   = help: the trait `FromResidual<_>` is not implemented for `()`
+   = note: only supported directly in conditions of `if` and `while` expressions
 
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:152:8
-   |
-LL |     if x = let 0 = 0 {}
-   |        ^^^^^^^^^^^^^ expected `bool`, found `()`
+error: expected expression, found `let` statement
+  --> $DIR/disallowed-positions.rs:83:16
    |
-help: you might have meant to compare for equality
+LL |     use_expr!((let 0 = 1));
+   |                ^^^
    |
-LL |     if x == let 0 = 0 {}
-   |           +
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:157:8
+  --> $DIR/disallowed-positions.rs:119:8
    |
 LL |     if true..(let 0 = 0) {}
    |        ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
@@ -1522,25 +876,7 @@ LL |     if true..(let 0 = 0) {}
             found struct `std::ops::Range<bool>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:161:8
-   |
-LL |     if ..(let 0 = 0) {}
-   |        ^^^^^^^^^^^^^ expected `bool`, found `RangeTo<bool>`
-   |
-   = note: expected type `bool`
-            found struct `RangeTo<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:165:8
-   |
-LL |     if (let 0 = 0).. {}
-   |        ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom<bool>`
-   |
-   = note: expected type `bool`
-            found struct `RangeFrom<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:171:12
+  --> $DIR/disallowed-positions.rs:128:12
    |
 LL |     if let Range { start: _, end: _ } = true..true && false {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
@@ -1551,16 +887,7 @@ LL |     if let Range { start: _, end: _ } = true..true && false {}
             found struct `std::ops::Range<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:171:8
-   |
-LL |     if let Range { start: _, end: _ } = true..true && false {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:175:12
+  --> $DIR/disallowed-positions.rs:131:12
    |
 LL |     if let Range { start: _, end: _ } = true..true || false {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
@@ -1571,16 +898,7 @@ LL |     if let Range { start: _, end: _ } = true..true || false {}
             found struct `std::ops::Range<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:175:8
-   |
-LL |     if let Range { start: _, end: _ } = true..true || false {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:182:12
+  --> $DIR/disallowed-positions.rs:137:12
    |
 LL |     if let Range { start: F, end } = F..|| true {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `fn() -> bool`
@@ -1591,29 +909,7 @@ LL |     if let Range { start: F, end } = F..|| true {}
                   found struct `std::ops::Range<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:182:41
-   |
-LL |     if let Range { start: F, end } = F..|| true {}
-   |                                         ^^^^^^^ expected `bool`, found closure
-   |
-   = note: expected type `bool`
-           found closure `[closure@$DIR/disallowed-positions.rs:182:41: 182:43]`
-help: use parentheses to call this closure
-   |
-LL |     if let Range { start: F, end } = F..(|| true)() {}
-   |                                         +       +++
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:182:8
-   |
-LL |     if let Range { start: F, end } = F..|| true {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:190:12
+  --> $DIR/disallowed-positions.rs:143:12
    |
 LL |     if let Range { start: true, end } = t..&&false {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
@@ -1623,29 +919,8 @@ LL |     if let Range { start: true, end } = t..&&false {}
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
 
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:190:44
-   |
-LL |     if let Range { start: true, end } = t..&&false {}
-   |                                            ^^^^^^^ expected `bool`, found `&&bool`
-   |
-help: consider removing the `&&`
-   |
-LL -     if let Range { start: true, end } = t..&&false {}
-LL +     if let Range { start: true, end } = t..false {}
-   |
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:190:8
-   |
-LL |     if let Range { start: true, end } = t..&&false {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
 error[E0277]: the `?` operator can only be applied to values that implement `Try`
-  --> $DIR/disallowed-positions.rs:128:20
+  --> $DIR/disallowed-positions.rs:99:20
    |
 LL |         if let 0 = 0? {}
    |                    ^^ the `?` operator cannot be applied to type `{integer}`
@@ -1653,61 +928,7 @@ LL |         if let 0 = 0? {}
    = help: the trait `Try` is not implemented for `{integer}`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:202:11
-   |
-LL |     while &let 0 = 0 {}
-   |           ^^^^^^^^^^ expected `bool`, found `&bool`
-   |
-help: consider removing the borrow
-   |
-LL -     while &let 0 = 0 {}
-LL +     while let 0 = 0 {}
-   |
-
-error[E0614]: type `bool` cannot be dereferenced
-  --> $DIR/disallowed-positions.rs:210:11
-   |
-LL |     while *let 0 = 0 {}
-   |           ^^^^^^^^^^
-
-error[E0600]: cannot apply unary operator `-` to type `bool`
-  --> $DIR/disallowed-positions.rs:214:11
-   |
-LL |     while -let 0 = 0 {}
-   |           ^^^^^^^^^^ cannot apply unary operator `-`
-
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
-  --> $DIR/disallowed-positions.rs:224:11
-   |
-LL |     while (let 0 = 0)? {}
-   |           ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
-   |
-   = help: the trait `Try` is not implemented for `bool`
-
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
-  --> $DIR/disallowed-positions.rs:224:22
-   |
-LL | fn nested_within_while_expr() {
-   | ----------------------------- this function should return `Result` or `Option` to accept `?`
-...
-LL |     while (let 0 = 0)? {}
-   |                      ^ cannot use the `?` operator in a function that returns `()`
-   |
-   = help: the trait `FromResidual<_>` is not implemented for `()`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:244:11
-   |
-LL |     while x = let 0 = 0 {}
-   |           ^^^^^^^^^^^^^ expected `bool`, found `()`
-   |
-help: you might have meant to compare for equality
-   |
-LL |     while x == let 0 = 0 {}
-   |              +
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:249:11
+  --> $DIR/disallowed-positions.rs:183:11
    |
 LL |     while true..(let 0 = 0) {}
    |           ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
@@ -1716,25 +937,7 @@ LL |     while true..(let 0 = 0) {}
             found struct `std::ops::Range<bool>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:253:11
-   |
-LL |     while ..(let 0 = 0) {}
-   |           ^^^^^^^^^^^^^ expected `bool`, found `RangeTo<bool>`
-   |
-   = note: expected type `bool`
-            found struct `RangeTo<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:257:11
-   |
-LL |     while (let 0 = 0).. {}
-   |           ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom<bool>`
-   |
-   = note: expected type `bool`
-            found struct `RangeFrom<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:263:15
+  --> $DIR/disallowed-positions.rs:192:15
    |
 LL |     while let Range { start: _, end: _ } = true..true && false {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
@@ -1745,16 +948,7 @@ LL |     while let Range { start: _, end: _ } = true..true && false {}
             found struct `std::ops::Range<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:263:11
-   |
-LL |     while let Range { start: _, end: _ } = true..true && false {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:267:15
+  --> $DIR/disallowed-positions.rs:195:15
    |
 LL |     while let Range { start: _, end: _ } = true..true || false {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
@@ -1765,16 +959,7 @@ LL |     while let Range { start: _, end: _ } = true..true || false {}
             found struct `std::ops::Range<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:267:11
-   |
-LL |     while let Range { start: _, end: _ } = true..true || false {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:274:15
+  --> $DIR/disallowed-positions.rs:201:15
    |
 LL |     while let Range { start: F, end } = F..|| true {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `fn() -> bool`
@@ -1785,29 +970,7 @@ LL |     while let Range { start: F, end } = F..|| true {}
                   found struct `std::ops::Range<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:274:44
-   |
-LL |     while let Range { start: F, end } = F..|| true {}
-   |                                            ^^^^^^^ expected `bool`, found closure
-   |
-   = note: expected type `bool`
-           found closure `[closure@$DIR/disallowed-positions.rs:274:44: 274:46]`
-help: use parentheses to call this closure
-   |
-LL |     while let Range { start: F, end } = F..(|| true)() {}
-   |                                            +       +++
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:274:11
-   |
-LL |     while let Range { start: F, end } = F..|| true {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:282:15
+  --> $DIR/disallowed-positions.rs:207:15
    |
 LL |     while let Range { start: true, end } = t..&&false {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
@@ -1817,68 +980,16 @@ LL |     while let Range { start: true, end } = t..&&false {}
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
 
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:282:47
-   |
-LL |     while let Range { start: true, end } = t..&&false {}
-   |                                               ^^^^^^^ expected `bool`, found `&&bool`
-   |
-help: consider removing the `&&`
-   |
-LL -     while let Range { start: true, end } = t..&&false {}
-LL +     while let Range { start: true, end } = t..false {}
-   |
-
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:282:11
-   |
-LL |     while let Range { start: true, end } = t..&&false {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
-   |
-   = note: expected type `bool`
-            found struct `std::ops::Range<bool>`
-
 error[E0277]: the `?` operator can only be applied to values that implement `Try`
-  --> $DIR/disallowed-positions.rs:220:23
+  --> $DIR/disallowed-positions.rs:163:23
    |
 LL |         while let 0 = 0? {}
    |                       ^^ the `?` operator cannot be applied to type `{integer}`
    |
    = help: the trait `Try` is not implemented for `{integer}`
 
-error[E0614]: type `bool` cannot be dereferenced
-  --> $DIR/disallowed-positions.rs:311:5
-   |
-LL |     *let 0 = 0;
-   |     ^^^^^^^^^^
-
-error[E0600]: cannot apply unary operator `-` to type `bool`
-  --> $DIR/disallowed-positions.rs:315:5
-   |
-LL |     -let 0 = 0;
-   |     ^^^^^^^^^^ cannot apply unary operator `-`
-
-error[E0277]: the `?` operator can only be applied to values that implement `Try`
-  --> $DIR/disallowed-positions.rs:325:5
-   |
-LL |     (let 0 = 0)?;
-   |     ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
-   |
-   = help: the trait `Try` is not implemented for `bool`
-
-error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
-  --> $DIR/disallowed-positions.rs:325:16
-   |
-LL | fn outside_if_and_while_expr() {
-   | ------------------------------ this function should return `Result` or `Option` to accept `?`
-...
-LL |     (let 0 = 0)?;
-   |                ^ cannot use the `?` operator in a function that returns `()`
-   |
-   = help: the trait `FromResidual<_>` is not implemented for `()`
-
 error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:356:10
+  --> $DIR/disallowed-positions.rs:262:10
    |
 LL |     (let Range { start: _, end: _ } = true..true || false);
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
@@ -1888,24 +999,15 @@ LL |     (let Range { start: _, end: _ } = true..true || false);
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
 
-error[E0308]: mismatched types
-  --> $DIR/disallowed-positions.rs:379:5
-   |
-LL | fn outside_if_and_while_expr() {
-   |                                - help: try adding a return type: `-> &bool`
-...
-LL |     &let 0 = 0
-   |     ^^^^^^^^^^ expected `()`, found `&bool`
-
 error[E0277]: the `?` operator can only be applied to values that implement `Try`
-  --> $DIR/disallowed-positions.rs:321:17
+  --> $DIR/disallowed-positions.rs:237:17
    |
 LL |         let 0 = 0?;
    |                 ^^ the `?` operator cannot be applied to type `{integer}`
    |
    = help: the trait `Try` is not implemented for `{integer}`
 
-error: aborting due to 215 previous errors
+error: aborting due to 104 previous errors
 
-Some errors have detailed explanations: E0277, E0308, E0600, E0614.
+Some errors have detailed explanations: E0277, E0308.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
index 2a6c144350a..3c572054e3f 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
@@ -14,7 +14,6 @@ fn main() {
     };
     let Some(n) = opt && let another = n else {
     //~^ ERROR a `&&` expression cannot be directly assigned in `let...else`
-    //~| ERROR `let` expressions are not supported here
     //~| ERROR mismatched types
     //~| ERROR mismatched types
     //~| ERROR expected expression, found `let` statement
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
index 9bc3e754126..0442f1218b1 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
@@ -14,6 +14,8 @@ error: expected expression, found `let` statement
    |
 LL |     let Some(n) = opt && let another = n else {
    |                          ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: a `&&` expression cannot be directly assigned in `let...else`
   --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
@@ -27,13 +29,13 @@ LL |     let Some(n) = (opt && let another = n) else {
    |                   +                      +
 
 error: this `if` expression is missing a block after the condition
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:5
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:23:5
    |
 LL |     if let Some(n) = opt else {
    |     ^^
    |
 help: add a block here
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:24:25
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:23:25
    |
 LL |     if let Some(n) = opt else {
    |                         ^
@@ -44,31 +46,31 @@ LL +     let Some(n) = opt else {
    |
 
 error: this `if` expression is missing a block after the condition
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:5
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:27:5
    |
 LL |     if let Some(n) = opt && n == 1 else {
    |     ^^
    |
 help: add a block here
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:28:35
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:27:35
    |
 LL |     if let Some(n) = opt && n == 1 else {
    |                                   ^
 
 error: this `if` expression is missing a block after the condition
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:32:5
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:31:5
    |
 LL |     if let Some(n) = opt && let another = n else {
    |     ^^
    |
 help: add a block here
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:32:44
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:31:44
    |
 LL |     if let Some(n) = opt && let another = n else {
    |                                            ^
 
 error: expected `{`, found keyword `else`
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:38:33
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:37:33
    |
 LL |         while let Some(n) = opt else {
    |         ----- ----------------- ^^^^ expected `{`
@@ -77,7 +79,7 @@ LL |         while let Some(n) = opt else {
    |         while parsing the body of this `while` expression
 
 error: expected `{`, found keyword `else`
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:44:43
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:43:43
    |
 LL |         while let Some(n) = opt && n == 1 else {
    |         ----- --------------------------- ^^^^ expected `{`
@@ -86,7 +88,7 @@ LL |         while let Some(n) = opt && n == 1 else {
    |         while parsing the body of this `while` expression
 
 error: expected `{`, found keyword `else`
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:50:52
+  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:49:52
    |
 LL |         while let Some(n) = opt && let another = n else {
    |         ----- ------------------------------------ ^^^^ expected `{`
@@ -94,14 +96,6 @@ LL |         while let Some(n) = opt && let another = n else {
    |         |     this `while` condition successfully parsed
    |         while parsing the body of this `while` expression
 
-error: `let` expressions are not supported here
-  --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:26
-   |
-LL |     let Some(n) = opt && let another = n else {
-   |                          ^^^^^^^^^^^^^^^
-   |
-   = note: only supported directly in conditions of `if` and `while` expressions
-
 error[E0308]: mismatched types
   --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
    |
@@ -142,6 +136,6 @@ LL |     let Some(n) = opt && let another = n else {
    = note: expected type `bool`
               found enum `Option<_>`
 
-error: aborting due to 14 previous errors
+error: aborting due to 13 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs
index 2b407ef510c..bca7564efd8 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs
@@ -43,8 +43,7 @@ fn _macros() {
     macro_rules! noop_expr { ($e:expr) => {}; }
 
     noop_expr!((let 0 = 1));
-    //~^ ERROR `let` expressions in this position are unstable [E0658]
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
 
     macro_rules! use_expr {
         ($e:expr) => {
@@ -53,8 +52,7 @@ fn _macros() {
         }
     }
     #[cfg(FALSE)] (let 0 = 1);
-    //~^ ERROR `let` expressions in this position are unstable [E0658]
-    //~| ERROR expected expression, found `let` statement
+    //~^ ERROR expected expression, found `let` statement
     use_expr!(let 0 = 1);
     //~^ ERROR no rules expected the token `let`
 }
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr
index 7a43b71fc8b..6f74736755e 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr
@@ -1,17 +1,21 @@
 error: expected expression, found `let` statement
-  --> $DIR/feature-gate.rs:55:20
+  --> $DIR/feature-gate.rs:54:20
    |
 LL |     #[cfg(FALSE)] (let 0 = 1);
    |                    ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: expected expression, found `let` statement
   --> $DIR/feature-gate.rs:45:17
    |
 LL |     noop_expr!((let 0 = 1));
    |                 ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: no rules expected the token `let`
-  --> $DIR/feature-gate.rs:58:15
+  --> $DIR/feature-gate.rs:56:15
    |
 LL |     macro_rules! use_expr {
    |     --------------------- when calling this macro
@@ -20,7 +24,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:50:10
+  --> $DIR/feature-gate.rs:49:10
    |
 LL |         ($e:expr) => {
    |          ^^^^^^^
@@ -97,24 +101,6 @@ 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
 
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:55:20
-   |
-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
-
-error[E0658]: `let` expressions in this position are unstable
-  --> $DIR/feature-gate.rs:45:17
-   |
-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
-
-error: aborting due to 13 previous errors
+error: aborting due to 11 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
index a942d1f4caf..dce1c19ff33 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs
@@ -13,6 +13,7 @@ fn main() {
         if let Some(elem) = _opt && [1, 2, 3][let _ = &&let Some(x) = Some(42)] = 1 {
         //~^ ERROR expected expression, found `let` statement
         //~| ERROR expected expression, found `let` statement
+        //~| ERROR expected expression, found `let` statement
             true
         }
     }
@@ -31,6 +32,7 @@ fn main() {
     {
         if let Some(elem) = _opt && [1, 2, 3][let _ = ()] = 1 {
         //~^ ERROR expected expression, found `let` statement
+        //~| ERROR expected expression, found `let` statement
             true
         }
     }
diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr
index d1ce83c7233..247fad2e992 100644
--- a/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr
+++ b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr
@@ -3,36 +3,64 @@ error: expected expression, found `let` statement
    |
 LL |         let _ = &&let Some(x) = Some(42);
    |                   ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: expected expression, found `let` statement
   --> $DIR/invalid-let-in-a-valid-let-context.rs:13:47
    |
 LL |         if let Some(elem) = _opt && [1, 2, 3][let _ = &&let Some(x) = Some(42)] = 1 {
    |                                               ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: expected expression, found `let` statement
   --> $DIR/invalid-let-in-a-valid-let-context.rs:13:57
    |
 LL |         if let Some(elem) = _opt && [1, 2, 3][let _ = &&let Some(x) = Some(42)] = 1 {
    |                                                         ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/invalid-let-in-a-valid-let-context.rs:13:12
+   |
+LL |         if let Some(elem) = _opt && [1, 2, 3][let _ = &&let Some(x) = Some(42)] = 1 {
+   |            ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: expected expression, found `let` statement
-  --> $DIR/invalid-let-in-a-valid-let-context.rs:23:23
+  --> $DIR/invalid-let-in-a-valid-let-context.rs:24:23
    |
 LL |             [1, 2, 3][let _ = ()];
    |                       ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: expected expression, found `let` statement
-  --> $DIR/invalid-let-in-a-valid-let-context.rs:32:47
+  --> $DIR/invalid-let-in-a-valid-let-context.rs:33:47
    |
 LL |         if let Some(elem) = _opt && [1, 2, 3][let _ = ()] = 1 {
    |                                               ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
+
+error: expected expression, found `let` statement
+  --> $DIR/invalid-let-in-a-valid-let-context.rs:33:12
+   |
+LL |         if let Some(elem) = _opt && [1, 2, 3][let _ = ()] = 1 {
+   |            ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
 error: expected expression, found `let` statement
-  --> $DIR/invalid-let-in-a-valid-let-context.rs:40:21
+  --> $DIR/invalid-let-in-a-valid-let-context.rs:42:21
    |
 LL |             let x = let y = 1;
    |                     ^^^
+   |
+   = note: only supported directly in conditions of `if` and `while` expressions
 
-error: aborting due to 6 previous errors
+error: aborting due to 8 previous errors