Skip to content

1.18.0 and nightly ICE on invalid enum declaration  #43195

Closed
@zhendongsu

Description

@zhendongsu
$ rustc --version
rustc 1.20.0-nightly (bf0a9e0b4 2017-07-10)
$
$ rustc tmp.rs
error: internal compiler error: /checkout/src/librustc_mir/build/matches/mod.rs:157: match pairs [MatchPair { lvalue: _1, pattern: Pattern { ty: i32, span: tmp.rs:2:13: 2:14, kind: Constant { value: Integral(I32(0)) } }, slice_len_checked: false }] remaining after simplifying irrefutable pattern
 --> tmp.rs:2:13
  |
2 |   A = { let 0 = 0; 0 }
  |             ^

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.20.0-nightly (bf0a9e0b4 2017-07-10) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:437:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

$
$ rustc-1.18.0 --version
rustc 1.18.0 (03fc9d622 2017-06-06)
$
$ rustc-1.18.0 tmp.rs
error: internal compiler error: /checkout/src/librustc_mir/build/matches/mod.rs:157: match pairs [MatchPair { lvalue: _1, pattern: Pattern { ty: i32, span: tmp.rs:2:13: 2:14, kind: Constant { value: Integral(I32(0)) } }, slice_len_checked: false }] remaining after simplifying irrefutable pattern
 --> tmp.rs:2:13
  |
2 |   A = { let 0 = 0; 0 }
  |             ^

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:375
note: Run with `RUST_BACKTRACE=1` for a backtrace.

$
$ cat tmp.rs
enum E {
  A = { let 0 = 0; 0 }
}

fn main () {}
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions