1 error[E0308]: `else` clause of `let...else` does not diverge
2 --> $DIR/let-else-non-diverging.rs:2:32
4 LL | let Some(x) = Some(1) else {
5 | ________________________________^
8 | |_____^ expected `!`, found enum `Option`
10 = note: expected type `!`
11 found enum `Option<{integer}>`
12 = help: try adding a diverging expression, such as `return` or `panic!(..)`
13 = help: ...or use `match` instead of `let...else`
15 error[E0308]: `else` clause of `let...else` does not diverge
16 --> $DIR/let-else-non-diverging.rs:5:32
18 LL | let Some(x) = Some(1) else {
19 | ________________________________^
24 | |_____^ expected `!`, found `()`
26 = note: expected type `!`
28 = help: try adding a diverging expression, such as `return` or `panic!(..)`
29 = help: ...or use `match` instead of `let...else`
31 error[E0308]: `else` clause of `let...else` does not diverge
32 --> $DIR/let-else-non-diverging.rs:10:32
34 LL | let Some(x) = Some(1) else { Some(2) };
35 | ^^^^^^^^^^^ expected `!`, found enum `Option`
37 = note: expected type `!`
38 found enum `Option<{integer}>`
39 = help: try adding a diverging expression, such as `return` or `panic!(..)`
40 = help: ...or use `match` instead of `let...else`
42 error[E0308]: `else` clause of `let...else` does not diverge
43 --> $DIR/let-else-non-diverging.rs:15:32
45 LL | let Some(x) = Some(1) else { foo::<Uninhabited>() };
46 | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited`
48 = note: expected type `!`
49 found enum `Uninhabited`
50 = help: try adding a diverging expression, such as `return` or `panic!(..)`
51 = help: ...or use `match` instead of `let...else`
53 error: aborting due to 4 previous errors
55 For more information about this error, try `rustc --explain E0308`.