Skip to content
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

Compiler crash on "if" without "else" in async fn #66387

Closed
guzt opened this issue Nov 13, 2019 · 3 comments · Fixed by #66391
Closed

Compiler crash on "if" without "else" in async fn #66387

guzt opened this issue Nov 13, 2019 · 3 comments · Fixed by #66391
Labels
A-async-await Area: Async & Await A-coroutines Area: Coroutines C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@guzt
Copy link

guzt commented Nov 13, 2019

async fn f() -> Result<(), failure::Error> {
    if "a" != "b" {
        return Err("c".to_string());
    }
}

(Playground)

Triggers on playground on beta and nightly channels, not on stable.

Stacktrace: https://gist.github.com/guzt/32437a394c5c3401f8ec80a6863efe56

@guzt
Copy link
Author

guzt commented Nov 13, 2019

Even smaller sample (from @ComputerDruid):

async fn f() -> i32 {
    if true {
        return 0;
    }
}

@jonas-schievink jonas-schievink added A-async-await Area: Async & Await A-coroutines Area: Coroutines C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Nov 13, 2019
@pnkfelix
Copy link
Member

triage: P-high. Removing nomination.

@pnkfelix
Copy link
Member

triage: P-high, removing nomination label.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Nov 14, 2019
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Nov 14, 2019
tmandry added a commit to tmandry/rust that referenced this issue Nov 14, 2019
Do not ICE in `if` without `else` in `async fn`

Fix rust-lang#66387.
JohnTitor added a commit to JohnTitor/rust that referenced this issue Nov 15, 2019
Do not ICE in `if` without `else` in `async fn`

Fix rust-lang#66387.
JohnTitor added a commit to JohnTitor/rust that referenced this issue Nov 15, 2019
Do not ICE in `if` without `else` in `async fn`

Fix rust-lang#66387.
@bors bors closed this as completed in c5b6dce Nov 15, 2019
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 A-coroutines Area: Coroutines C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants