Skip to content

pattern guard causes assertion failure #6289

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

Closed
kimhyunkang opened this issue May 7, 2013 · 2 comments
Closed

pattern guard causes assertion failure #6289

kimhyunkang opened this issue May 7, 2013 · 2 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@kimhyunkang
Copy link

I encountered an assertion failure in rustc 0.6

fn main() {
    let x = Some(3);
    let y = 0;

    match(x) {
        None => println("None"),
        _ if y == 0 => println("y is zero"),
        Some(n) => println(fmt!("Some(%d)", n)),
    }
}

Above is a simple test code to reproduce the bug
(Yes it is a silly code which can be rephrased into match nested in if)

kimhyunkang$ RUST_LOG=rustc=1,::rt::backtrace rustc test.rs
rust: task failed at 'assertion failed: (m.len() > 0u || chk.is_some())', /Users/kimhyunkang/usr/pkgs/rust-0.6/src/librustc/middle/trans/_match.rs:1262
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/kimhyunkang/usr/pkgs/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7f8789819410 root task failed
@jdm
Copy link
Contributor

jdm commented May 7, 2013

Nominating for production-ready.

@catamorphism
Copy link
Contributor

Thanks for the bug report, @kimhyunkang -- this is actually a duplicate of a long-standing bug, #3121. It's a good reminder to escalate that bug, though!

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 6, 2020
…p1995

do not trigger MATCH_LIKE_MATCHES_MACRO lint with attrs

fixed rust-lang#6289
changelog: do not trigger MATCH_LIKE_MATCHES_MACRO lint for arms with attrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants