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

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

Closed
darxriggs opened this issue Aug 24, 2015 · 2 comments
Closed

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

darxriggs opened this issue Aug 24, 2015 · 2 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@darxriggs
Copy link

$ 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
@arielb1 arielb1 added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Aug 31, 2015
@c4rlo
Copy link
Contributor

c4rlo commented Nov 5, 2016

Looks like this was fixed. Output with current nightly as per playground:

rustc 1.14.0-nightly (5665bdf3e 2016-11-02)
error[E0532]: expected tuple struct/variant, found constant `StructConst1`
 --> <anon>:5:9
  |
5 |         StructConst1(_) => { },
  |         ^^^^^^^^^^^^

error: aborting due to previous error

@Mark-Simulacrum
Copy link
Member

Yeah, this was fixed. Marking as E-needstest.

@Mark-Simulacrum Mark-Simulacrum added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label May 15, 2017
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed C-bug Category: This is a bug. labels Jul 22, 2017
topecongiro added a commit to topecongiro/rust that referenced this issue Dec 26, 2017
bors added a commit that referenced this issue Dec 27, 2017
Add tests to fixed ICEs

Closes #27078. Closes #27985. Closes #39848. Closes #42164.
Closes #42479. Closes #45662. Closes #45965. Closes #46152.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants