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 A-generators C-bug glacier I-ICE P-high regression-from-stable-to-beta T-compiler

Comments

@guzt
Copy link

@guzt 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 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 A-generators C-bug I-ICE I-nominated T-compiler regression-from-stable-to-beta labels Nov 13, 2019
@pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Nov 14, 2019

triage: P-high. Removing nomination.

@pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented Nov 14, 2019

triage: P-high, removing nomination label.

@pnkfelix pnkfelix added P-high and removed I-nominated labels Nov 14, 2019
@rust-lang-glacier-bot rust-lang-glacier-bot added the 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await A-generators C-bug glacier I-ICE P-high regression-from-stable-to-beta T-compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants