-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
async fn foo() {
endless().await;
}
async fn endless() -> ! {
loop {}
}
I expected to see this happen: no build warn
Instead, this happened:
warning: unreachable expression
--> src/main.rs:8:5
|
8 | endless().await;
| ^^^^^^^^^^^^^^^
|
= note: #[warn(unreachable_code)] on by default
Meta
rustc --version --verbose
:
rustc 1.37.0-nightly (5f3656ce9 2019-06-11)
binary: rustc
commit-hash: 5f3656ce9a2212fad872605b7a4ee103a155e9f3
commit-date: 2019-06-11
host: x86_64-unknown-linux-gnu
release: 1.37.0-nightly
LLVM version: 8.0
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.