-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.F-unsized_locals`#![feature(unsized_locals)]``#![feature(unsized_locals)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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) {
_ => ()
};
}
kennytm
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.C-bugCategory: This is a bug.Category: This is a bug.F-unsized_locals`#![feature(unsized_locals)]``#![feature(unsized_locals)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.