mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Remove feature gate from let else suggestion
The let else suggestion added by 0d92752b8a
does not need a feature gate any more.
This commit is contained in:
parent
bca3cf7e86
commit
5633e863bd
@ -491,8 +491,8 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
|
||||
err.span_suggestion_verbose(
|
||||
semi_span.shrink_to_lo(),
|
||||
&format!(
|
||||
"alternatively, on nightly, you might want to use \
|
||||
`#![feature(let_else)]` to handle the variant{} that {} matched",
|
||||
"alternatively, you might want to use \
|
||||
let else to handle the variant{} that {} matched",
|
||||
pluralize!(witnesses.len()),
|
||||
match witnesses.len() {
|
||||
1 => "isn't",
|
||||
|
@ -18,7 +18,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let u = if let Helper::U(u) = Helper::T(t, []) { u } else { todo!() };
|
||||
| ++++++++++ ++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Helper::U(u) = Helper::T(t, []) else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let y = if let Some(y) = x { y } else { todo!() };
|
||||
| ++++++++++ ++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Some(y) = x else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let _x = if let Ok(_x) = foo() { _x } else { todo!() };
|
||||
| +++++++++++ +++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Ok(_x) = foo() else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -21,7 +21,7 @@ help: you might want to use `if let` to ignore the variants that aren't matched
|
||||
|
|
||||
LL | let y = if let Thing::Foo(y) = Thing::Foo(1) { y } else { todo!() };
|
||||
| ++++++++++ ++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
|
||||
help: alternatively, you might want to use let else to handle the variants that aren't matched
|
||||
|
|
||||
LL | let Thing::Foo(y) = Thing::Foo(1) else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -187,7 +187,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let _x = if let Opt::Some(ref _x) = e { _x } else { todo!() };
|
||||
| +++++++++++ +++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Opt::Some(ref _x) = e else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let x = if let Ok(x) = res { x } else { todo!() };
|
||||
| ++++++++++ ++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Ok(x) = res else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -18,7 +18,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let (_y, _z) = if let Foo::D(_y, _z) = x { (_y, _z) } else { todo!() };
|
||||
| +++++++++++++++++ +++++++++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Foo::D(_y, _z) = x else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
@ -122,7 +122,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
||||
|
|
||||
LL | let x = if let Ok(x) = x { x } else { todo!() };
|
||||
| ++++++++++ ++++++++++++++++++++++
|
||||
help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
|
||||
help: alternatively, you might want to use let else to handle the variant that isn't matched
|
||||
|
|
||||
LL | let Ok(x) = x else { todo!() };
|
||||
| ++++++++++++++++
|
||||
|
Loading…
Reference in New Issue
Block a user