Skip to content

the compiler unexpectedly panicked with message "no type for node" #27985

Closed
@darxriggs

Description

@darxriggs

$ RUST_BACKTRACE=1 rustc bug.rs

error: internal compiler error: no type for node 17: pat _ (id=17) in fcx 0x7ff96bbf0100
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>', ../src/libsyntax/diagnostic.rs:253
stack backtrace:
   1:     0x7ff973fb1729 - sys::backtrace::tracing::imp::write::h92bdd98a8c8a747b0ds
   2:     0x7ff973fb9426 - panicking::on_panic::he409884064d6483bSex
   3:     0x7ff973f7f59e - rt::unwind::begin_unwind_inner::haf4ef05209f3101bwHw
   4:     0x7ff970f5ee07 - rt::unwind::begin_unwind::h17268037719936606420
   5:     0x7ff970f603f6 - diagnostic::Handler::bug::hb07df958abb16b33P5A
   6:     0x7ff971f36d43 - session::Session::bug::h33fc597c2bb8d2b709v
   7:     0x7ff972fdca4e - check::FnCtxt<'a, 'tcx>::node_ty::hb4b1026b978aca98U4q
   8:     0x7ff972fe2fdc - check::writeback::WritebackCx<'cx, 'tcx>::visit_node_id::h5f3fd9c78b11a54dp3b
   9:     0x7ff972fe4732 - visit::walk_pat::h2893558893893026938
  10:     0x7ff972fe425e - visit::walk_arm::h14664322155872622309
  11:     0x7ff972fe1aa5 - check::writeback::WritebackCx<'cx, 'tcx>.Visitor<'v>::visit_expr::hb15588231feab792XSb
  12:     0x7ff972fe283e - check::writeback::resolve_type_vars_in_fn::he098bf76910794ff2Mb
  13:     0x7ff9730885e2 - check::check_bare_fn::h98c21cb43c95847cKrp
  14:     0x7ff973085d55 - check::check_item_body::h7b0adc9c689951a7wSp
  15:     0x7ff973141cc2 - check_crate::hfa8a7d9c8370637dwAE
  16:     0x7ff9744fe69e - driver::phase_3_run_analysis_passes::closure.20602
  17:     0x7ff9744dd4a5 - middle::ty::ctxt<'tcx>::create_and_enter::h15183903841397032080
  18:     0x7ff9744d860d - driver::phase_3_run_analysis_passes::h17141567865855329988
  19:     0x7ff9744bb836 - driver::compile_input::h9bea45f22baf7b4aTba
  20:     0x7ff9746276bb - run_compiler::h99c151c0b0f66c320bc
  21:     0x7ff974624f87 - boxed::F.FnBox<A>::call_box::h18442244978192831473
  22:     0x7ff9746249f4 - rt::unwind::try::try_fn::h18199909016432841204
  23:     0x7ff973fb8fc8 - __rust_try
  24:     0x7ff973fa59b2 - rt::unwind::try::inner_try::h814db2d02e3393d9pDw
  25:     0x7ff974624b88 - boxed::F.FnBox<A>::call_box::h2813546202767766572
  26:     0x7ff973fb8413 - sys::thread::Thread::new::thread_start::h3ccc701cd7e25ffecNv
  27:     0x7ff96db98181 - start_thread
  28:     0x7ff973c3347c - __clone
  29:                0x0 - <unknown>

$ cat bug.rs

fn main() {
    let value = 1;

    match SomeStruct(value) {
        StructConst1(_) => { },
        _ => { },
    }

    struct SomeStruct(u8);

    const StructConst1 : SomeStruct = SomeStruct(1);
    const StructConst2 : SomeStruct = SomeStruct(2);
}

$ rustc --version --verbose

rustc 1.4.0-nightly (63ba780fd 2015-08-23)
binary: rustc
commit-hash: 63ba780fd7ab506bfd0f92d34a39172b412cfbe1
commit-date: 2015-08-23
host: x86_64-unknown-linux-gnu
release: 1.4.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.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