Skip to content

Commit 5633e86

Browse files
committed
Remove feature gate from let else suggestion
The let else suggestion added by 0d92752 does not need a feature gate any more.
1 parent bca3cf7 commit 5633e86

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
491491
err.span_suggestion_verbose(
492492
semi_span.shrink_to_lo(),
493493
&format!(
494-
"alternatively, on nightly, you might want to use \
495-
`#![feature(let_else)]` to handle the variant{} that {} matched",
494+
"alternatively, you might want to use \
495+
let else to handle the variant{} that {} matched",
496496
pluralize!(witnesses.len()),
497497
match witnesses.len() {
498498
1 => "isn't",

src/test/ui/empty/empty-never-array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
1818
|
1919
LL | let u = if let Helper::U(u) = Helper::T(t, []) { u } else { todo!() };
2020
| ++++++++++ ++++++++++++++++++++++
21-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
21+
help: alternatively, you might want to use let else to handle the variant that isn't matched
2222
|
2323
LL | let Helper::U(u) = Helper::T(t, []) else { todo!() };
2424
| ++++++++++++++++

src/test/ui/error-codes/E0005.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
1919
|
2020
LL | let y = if let Some(y) = x { y } else { todo!() };
2121
| ++++++++++ ++++++++++++++++++++++
22-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
22+
help: alternatively, you might want to use let else to handle the variant that isn't matched
2323
|
2424
LL | let Some(y) = x else { todo!() };
2525
| ++++++++++++++++

src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
1919
|
2020
LL | let _x = if let Ok(_x) = foo() { _x } else { todo!() };
2121
| +++++++++++ +++++++++++++++++++++++
22-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
22+
help: alternatively, you might want to use let else to handle the variant that isn't matched
2323
|
2424
LL | let Ok(_x) = foo() else { todo!() };
2525
| ++++++++++++++++

src/test/ui/pattern/usefulness/issue-31561.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ help: you might want to use `if let` to ignore the variants that aren't matched
2121
|
2222
LL | let y = if let Thing::Foo(y) = Thing::Foo(1) { y } else { todo!() };
2323
| ++++++++++ ++++++++++++++++++++++
24-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
24+
help: alternatively, you might want to use let else to handle the variants that aren't matched
2525
|
2626
LL | let Thing::Foo(y) = Thing::Foo(1) else { todo!() };
2727
| ++++++++++++++++

src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
187187
|
188188
LL | let _x = if let Opt::Some(ref _x) = e { _x } else { todo!() };
189189
| +++++++++++ +++++++++++++++++++++++
190-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
190+
help: alternatively, you might want to use let else to handle the variant that isn't matched
191191
|
192192
LL | let Opt::Some(ref _x) = e else { todo!() };
193193
| ++++++++++++++++

src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
1919
|
2020
LL | let x = if let Ok(x) = res { x } else { todo!() };
2121
| ++++++++++ ++++++++++++++++++++++
22-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
22+
help: alternatively, you might want to use let else to handle the variant that isn't matched
2323
|
2424
LL | let Ok(x) = res else { todo!() };
2525
| ++++++++++++++++

src/test/ui/uninhabited/uninhabited-irrefutable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
1818
|
1919
LL | let (_y, _z) = if let Foo::D(_y, _z) = x { (_y, _z) } else { todo!() };
2020
| +++++++++++++++++ +++++++++++++++++++++++++++++
21-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
21+
help: alternatively, you might want to use let else to handle the variant that isn't matched
2222
|
2323
LL | let Foo::D(_y, _z) = x else { todo!() };
2424
| ++++++++++++++++

src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
122122
|
123123
LL | let x = if let Ok(x) = x { x } else { todo!() };
124124
| ++++++++++ ++++++++++++++++++++++
125-
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
125+
help: alternatively, you might want to use let else to handle the variant that isn't matched
126126
|
127127
LL | let Ok(x) = x else { todo!() };
128128
| ++++++++++++++++

0 commit comments

Comments
 (0)