diff options
Diffstat (limited to 'src/test/ui/let-else/let-else-non-diverging.stderr')
-rw-r--r-- | src/test/ui/let-else/let-else-non-diverging.stderr | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/ui/let-else/let-else-non-diverging.stderr b/src/test/ui/let-else/let-else-non-diverging.stderr index c999a5495..78551fcc4 100644 --- a/src/test/ui/let-else/let-else-non-diverging.stderr +++ b/src/test/ui/let-else/let-else-non-diverging.stderr @@ -39,6 +39,17 @@ LL | let Some(x) = Some(1) else { Some(2) }; = help: try adding a diverging expression, such as `return` or `panic!(..)` = help: ...or use `match` instead of `let...else` -error: aborting due to 3 previous errors +error[E0308]: `else` clause of `let...else` does not diverge + --> $DIR/let-else-non-diverging.rs:15:32 + | +LL | let Some(x) = Some(1) else { foo::<Uninhabited>() }; + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited` + | + = note: expected type `!` + found enum `Uninhabited` + = help: try adding a diverging expression, such as `return` or `panic!(..)` + = help: ...or use `match` instead of `let...else` + +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0308`. |