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.
The following code gives a "must use" warning (which is awesome!), but the warning is not as clear as it could be:
This results in:
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.