Closed
Description
The code is the same as in #62284:
#![feature(async_await)]
use std::future::Future;
use std::pin::Pin;
type BoxFuture = Pin<Box<dyn Future<Output = ()>>>;
async fn foo() -> BoxFuture {
Box::pin(bar()) as _
}
async fn bar() {
let _ = foo().await;
}
This results in:
warning[E0381]: use of possibly uninitialized variable: `_`
--> src/lib.rs:17:13
|
17 | let _ = foo().await;
| ^^^^^^^^^^^ use of possibly uninitialized value
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
= note: for more information, try `rustc --explain E0729`
Metadata
Metadata
Assignees
Labels
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Async & AwaitAsync-await issues that are part of the "polish" areaCategory: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessHigh priorityRelevant to the compiler team, which will review and decide on the PR/issue.