Closed
Description
It seemed clear to me that having an unsized local across a yield point cannot work.
Indeed, you get an ICE with (playground):
#![feature(async_await)]
#![feature(unsized_locals)]
#![feature(gen_future)]
use std::future::poll_with_tls_context;
use std::pin::Pin;
use std::fmt::Display;
async fn foo2() {}
async fn foo(x: Box<dyn Display>) {
let x = *x;
foo2().await;
println!("hello {}", &x);
}
fn main() {
let mut a = foo(Box::new(5));
let b = unsafe {
Pin::new_unchecked(&mut a)
};
match poll_with_tls_context(b) {
_ => ()
};
}
Metadata
Metadata
Assignees
Labels
Area: Async & AwaitAsync-await issues that have been triaged during a working group meeting.Category: This is a bug.`#![feature(unsized_locals)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.