-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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
The following code gives a "must use" warning (which is awesome!), but the warning is not as clear as it could be:
#![feature(async_await)]
#![allow(dead_code)]
async fn foo() {
bar();
}
async fn bar() {
}
fn main() { }
This results in:
warning: unused implementer of `std::future::Future` that must be used
--> src/main.rs:5:5
|
5 | bar();
| ^^^^^^
|
= note: #[warn(unused_must_use)] on by default
= note: futures do nothing unless polled
it should probably say "futures do nothing unless you await them" or something. Most people won't know what 'polled' is all about, I think.
estebank, mleonhard and JinMaxxhdhoang and tigercosmos
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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.