#[must_use] seems to have no effect on async functions. This code generates no warnings:
#[must_use]
async fn launch_missiles() -> u32 {
42
}
#[tokio::main]
async fn main() {
launch_missiles().await;
}
Is this expected behavior, or is it a language design flaw / compiler bug?
If it's expected, what are my alternatives? It works fine if the return type is #[must_use] so I've started creating a MustUse<_> wrapper type. It seems like overkill, though. Am I missing a simpler workaround?