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

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

This comment has been minimized.

Copy link
Author

@guzt guzt commented Nov 13, 2019

Even smaller sample (from @ComputerDruid):

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

This comment has been minimized.

Copy link
Member

@pnkfelix pnkfelix commented Nov 14, 2019

triage: P-high. Removing nomination.

@pnkfelix

This comment has been minimized.

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
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 in c5b6dce Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.