You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to see this happen: Two error[E0004]: non-exhaustive patterns: type bool is non-empty
Instead, this happened: Only one is reported, in the async function. The error in the async function is still reported if the order is flipped. Making both functions sync or async correctly reports both errors. If there is any code following the faulty match, it is always reported as unreachable, despite no error being emitted for the preceding line in the sync function.
warning: unreachable statement
--> poc.rs:3:5
|
2 | match true {};
| ------------- any code following this expression is unreachable
3 | return;
| ^^^^^^^ unreachable statement
|
= note: `#[warn(unreachable_code)]` on by default
error[E0004]: non-exhaustive patterns: type `bool` is non-empty
--> poc.rs:2:11
|
2 | match true {};
| ^^^^
|
= note: the matched value is of type `bool`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
2 ~ match true {
3 + _ => todo!(),
4 ~ };
|
The match error now only in the sync function, and the unused arithmetic warning is missing
clubby789
changed the title
second 'non-empty patterns' error silenced by async function
errors silenced by presence of async function with errors
May 13, 2023
Uh oh!
There was an error while loading. Please reload this page.
I tried this code:
I expected to see this happen: Two
error[E0004]: non-exhaustive patterns: type bool is non-empty
Instead, this happened: Only one is reported, in the async function. The error in the async function is still reported if the order is flipped. Making both functions sync or async correctly reports both errors. If there is any code following the faulty match, it is always reported as unreachable, despite no error being emitted for the preceding line in the sync function.
Found in #111533 test
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: