-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE when playing with async/await. #62009
Labels
A-async-await
Area: Async & Await
AsyncAwait-Polish
Async-await issues that are part of the "polish" area
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Centril
added
A-async-await
Area: Async & Await
AsyncAwait-Polish
Async-await issues that are part of the "polish" area
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jun 21, 2019
Minimized: #![feature(async_await)]
async fn print_dur() {}
fn main() -> () {
async{
let task1 = print_dur().await;
}.await
} |
ICEs with any ICE #![feature(async_await)]
fn main() {
async { let (); }.await
}
Error without #![feature(async_await)]
fn main() {
async {}.await
}
#![feature(async_await)]
fn main() {
foo();
}
async fn foo() {
async { let (); }.await
}
|
@rustbot claim |
This is actually the same as #61685. I think I've got a fix for both. |
@doctorn do you have a PR for this open? |
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Centril
added a commit
to Centril/rust
that referenced
this issue
Jun 27, 2019
Don't ICE on item in `.await` expression The code for lowering a `.await` expression missed that item IDs may already have been assigned for items inside of an `async` block, or for closures. This change means we no longer exit early after finding a `.await` in a block that isn't `async` and instead just emit the error. This avoids an ICE generated due to item IDs not being densely generated. (The `YieldSource` of the generated `yield` expression is used to avoid errors generated about having `yield` expressions outside of generator literals.) r? @cramertj Resolves rust-lang#62009 and resolves rust-lang#61685
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-async-await
Area: Async & Await
AsyncAwait-Polish
Async-await issues that are part of the "polish" area
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi
I'm pretty new to rust and programming in general. I was trying (failing) to write some toy async code and I got this internal compiler error, the theme seems to be always report ICEs so here we go
This was from cargo:
The code I was trying was this code:
This issue has been assigned to @doctorn via this comment.
The text was updated successfully, but these errors were encountered: