],
Applicability::HasPlaceholders,
);
- if cx.tcx.sess.is_nightly_build() {
+ if !bindings.is_empty() && cx.tcx.sess.is_nightly_build() {
err.span_suggestion_verbose(
semi_span.shrink_to_lo(),
&format!(
|
LL | A = { if let 0 = 0 { todo!() } 0 },
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | A = { let 0 = 0 else { todo!() }; 0 },
- | ++++++++++++++++
error: aborting due to previous error
|
LL | let x: [i32; { if let 0 = 0 { todo!() } 0 }] = [];
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | let x: [i32; { let 0 = 0 else { todo!() }; 0 }] = [];
- | ++++++++++++++++
error: aborting due to previous error
|
LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | const X: i32 = { let 0 = 0 else { todo!() }; 0 };
- | ++++++++++++++++
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:8:23
|
LL | static Y: i32 = { if let 0 = 0 { todo!() } 0 };
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | static Y: i32 = { let 0 = 0 else { todo!() }; 0 };
- | ++++++++++++++++
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:13:26
|
LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | const X: i32 = { let 0 = 0 else { todo!() }; 0 };
- | ++++++++++++++++
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:19:26
|
LL | const X: i32 = { if let 0 = 0 { todo!() } 0 };
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | const X: i32 = { let 0 = 0 else { todo!() }; 0 };
- | ++++++++++++++++
error: aborting due to 4 previous errors
|
LL | if let (0 | (1 | 2)) = 0 { todo!() }
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | let (0 | (1 | 2)) = 0 else { todo!() };
- | ++++++++++++++++
error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
--> $DIR/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs:3:11
|
LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | let E::A = e else { todo!() };
- | ++++++++++++++++
error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered
--> $DIR/non-exhaustive-defined-here.rs:52:11
|
LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | let E::A = e else { todo!() };
- | ++++++++++++++++
error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
--> $DIR/non-exhaustive-defined-here.rs:66:11
|
LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | let E::A = e else { todo!() };
- | ++++++++++++++++
error[E0004]: non-exhaustive patterns: `None` not covered
--> $DIR/non-exhaustive-defined-here.rs:92:11
|
LL | if let (1, (Some(1), 2..=3)) = (1, (None, 2)) { todo!() }
| ++ ~~~~~~~~~~~
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
- |
-LL | let (1, (Some(1), 2..=3)) = (1, (None, 2)) else { todo!() };
- | ++++++++++++++++
error: aborting due to 2 previous errors