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

ICE instead "non-exhaustive patterns" warning #40221

Closed
swizard0 opened this issue Mar 3, 2017 · 2 comments
Closed

ICE instead "non-exhaustive patterns" warning #40221

swizard0 opened this issue Mar 3, 2017 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

@swizard0
Copy link

swizard0 commented Mar 3, 2017

The minimum code example:

enum P {
    C(PC),
}

enum PC {
    Q,
    QA,
}

fn test(proto: P) {
    match proto {
        P::C(PC::Q) =>
            (),
    }
}

fn main() {
}

compiling:

% RUST_BACKTRACE=1 rustc tmp.rs
error: internal compiler error: unexpected panic

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: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'assertion failed: !self.is_enum()', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/librustc/ty/mod.rs:1497
stack backtrace:
   1:        0x1109feb2c - std::sys::imp::backtrace::tracing::imp::write::h36dcd6719b30e145
   2:        0x110a0b23e - std::panicking::default_hook::{{closure}}::h4ef47a6ed549d2e6
   3:        0x110a0ade3 - std::panicking::default_hook::hd7b4c7a7e16abb43
   4:        0x110a0b6f7 - std::panicking::rust_panic_with_hook::h33761bada49f3713
   5:        0x10cfdd214 - std::panicking::begin_panic::h95dab7ee8de9a9da
   6:        0x10d218b4e - rustc::ty::AdtDef::struct_variant::he28eaae9d1b9c7a8
   7:        0x10cdd1f65 - <rustc_const_eval::pattern::Pattern<'tcx> as core::fmt::Display>::fmt::hb2bc146bc61c0c23
   8:        0x110a4a605 - core::fmt::write::h7f41c54d8315ce0a
   9:        0x110a0ea4e - collections::fmt::format::h201c2e3c43f15470
  10:        0x10cdce0cb - rustc_const_eval::check_match::MatchVisitor::check_match::{{closure}}::h8765d658afab62bb
  11:        0x10cdcb972 - <rustc_const_eval::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr::h210885977704b1c0
  12:        0x10cdca5c0 - <rustc_const_eval::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr::h210885977704b1c0
  13:        0x10cdcc580 - <rustc_const_eval::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body::hd194e1221abb715e
  14:        0x10cdc9167 - <rustc_const_eval::check_match::OuterVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_fn::h8c77996733ab8e7f
  15:        0x10cdad74c - rustc::hir::intravisit::walk_item::h404488f94d153f69
  16:        0x10cdc96a3 - rustc_const_eval::check_match::check_crate::hccfb63f4ad1088e1
  17:        0x10bdcf2e7 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h92434f8a72606098
  18:        0x10bd3a647 - rustc::ty::context::TyCtxt::create_and_enter::hf370726397099108
  19:        0x10bdafae7 - rustc_driver::driver::compile_input::h32ceef72bc3e1387
  20:        0x10bdf268e - rustc_driver::run_compiler::h98c0b71fc02a61c6
  21:        0x10bd01cd8 - std::panicking::try::do_call::hf2fe29fc9d77605e
  22:        0x110a0e30a - __rust_maybe_catch_panic
  23:        0x10bd2c123 - <F as alloc::boxed::FnBox<A>>::call_box::h3b47a718dac9d04a
  24:        0x110a0a364 - std::sys::imp::thread::Thread::new::thread_start::he1b44499d44cc4a4
  25:     0x7fffd3112aaa - _pthread_body
  26:     0x7fffd31129f6 - _pthread_start
rustc 1.16.0-nightly (bf6d7b665 2017-01-15)
@est31
Copy link
Member

est31 commented Mar 3, 2017

Thats a regression from stable → beta/nightly.

@TimNN TimNN added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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. labels Mar 3, 2017
@estebank
Copy link
Contributor

estebank commented Mar 5, 2017

Introduced by c001b0940c1.

estebank added a commit to estebank/rust that referenced this issue Mar 6, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 6, 2017
Fix ICE: don't use `struct_variant` on enums

Fix rust-lang#40221 and add unittest.
estebank added a commit to estebank/rust that referenced this issue Mar 6, 2017
bors added a commit that referenced this issue Mar 6, 2017
Fix ICE: don't use `struct_variant` on enums

Fix #40221 and add unittest.
brson pushed a commit to brson/rust that referenced this issue Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ 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

No branches or pull requests

4 participants