mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
warning: unreachable `else` clause
|
|
--> $DIR/let-else-irrefutable.rs:4:15
|
|
|
|
|
LL | let x = 1 else { return };
|
|
| --------- ^^^^
|
|
| |
|
|
| assigning to binding pattern will always succeed
|
|
|
|
|
= note: this pattern always matches, so the else clause is unreachable
|
|
= note: `#[warn(irrefutable_let_patterns)]` on by default
|
|
|
|
warning: unreachable `else` clause
|
|
--> $DIR/let-else-irrefutable.rs:7:15
|
|
|
|
|
LL | let x = 1 else {
|
|
| --------- ^^^^
|
|
| |
|
|
| assigning to binding pattern will always succeed
|
|
|
|
|
= note: this pattern always matches, so the else clause is unreachable
|
|
|
|
warning: unreachable `else` clause
|
|
--> $DIR/let-else-irrefutable.rs:13:27
|
|
|
|
|
LL | let name = Some(case) else {
|
|
| --------------------- ^^^^
|
|
| |
|
|
| assigning to binding pattern will always succeed
|
|
|
|
|
= note: this pattern always matches, so the else clause is unreachable
|
|
help: consider using `let Some(name) = case` to match on a specific variant
|
|
|
|
|
LL - let name = Some(case) else {
|
|
LL + let Some(name) = case else {
|
|
|
|
|
|
|
warning: 3 warnings emitted
|
|
|