Closed
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.
Metadata
Metadata
Assignees
Labels
Area: Async & AwaitArea: Messages for errors, warnings, and lintsCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.