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: no type for node #43727

Closed
tones111 opened this issue Aug 8, 2017 · 2 comments · Fixed by #43745
Closed

ICE: no type for node #43727

tones111 opened this issue Aug 8, 2017 · 2 comments · Fixed by #43745
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@tones111
Copy link
Contributor

tones111 commented Aug 8, 2017

While in the course of writing some code I happened across the following ICE when running cargo check with the current stable version of the compiler. I tried the same on a nightly build and got the same error.

This code is not at all anything I'd consider remotely presentable, but it seems attempts to try and minimize don't trigger the ICE. Similarly, fixing either of the compilation errors prior to the ICE also prevent its occurrence. This leads me to think this is some wild corner case, but hopefully will be useful.

stable compiler: rustc 1.19.0 (0ade339 2017-07-17)
nightly compiler: rustc 1.20.0-nightly (ae98ebf 2017-07-20)

$ uname -a
Linux mogul 4.12.4-1-ARCH #1 SMP PREEMPT Fri Jul 28 18:54:18 UTC 2017 x86_64 GNU/Linux

Please let me know if you are unable to reproduce. Thanks
rustic.zip

Error:
error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:1984: no type for node 443: expr Err(::fmt::format(<::std::fmt::Arguments>::new_v1({
static __STATIC_FMTSTR:
&'static [&'static str]
=
&["not implemented (",
":", ")"];
__STATIC_FMTSTR
},
&match (&"src/git/repo.rs",
&47u32) {
(__arg0, __arg1) =>
[<::std::fmt::ArgumentV1>::new(__arg0,
::std::fmt::Display::fmt),
<::std::fmt::ArgumentV1>::new(__arg1,
::std::fmt::Display::fmt)],
})).into()) (id=443) in fcx 0x7fce723f36e0

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 (ae98ebf 2017-07-20) running on x86_64-unknown-linux-gnu

note: run with RUST_BACKTRACE=1 for a backtrace

thread 'rustc' panicked at 'Box', /checkout/src/librustc_errors/lib.rs:489:8
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
at /checkout/src/libstd/panicking.rs:380
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:390
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:611
5: std::panicking::begin_panic_new
6: rustc_errors::Handler::bug
7: rustc::session::opt_span_bug_fmt::{{closure}}
8: rustc::session::opt_span_bug_fmt
9: rustc::session::bug_fmt
10: rustc_typeck::check::FnCtxt::node_ty
11: <rustc_typeck::check::regionck::RegionCtxt<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
12: <rustc_typeck::check::regionck::RegionCtxt<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
13: rustc::hir::intravisit::walk_expr
14: <rustc_typeck::check::regionck::RegionCtxt<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
15: rustc_typeck::check::regionck::RegionCtxt::visit_fn_body
16: rustc_typeck::check::typeck_tables_of::{{closure}}
17: rustc_typeck::check::typeck_tables_of
18: rustc::dep_graph::graph::DepGraph::with_task
19: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
20: rustc::ty::maps::TyCtxtAt::typeck_tables_of
21: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
22: rustc_typeck::check::typeck_item_bodies
23: rustc::dep_graph::graph::DepGraph::with_task
24: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
25: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
26: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
27: rustc_typeck::check_crate
28: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}
29: rustc_driver::driver::phase_3_run_analysis_passes
30: rustc_driver::driver::compile_input
31: rustc_driver::run_compiler

@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Aug 8, 2017
@kennytm
Copy link
Member

kennytm commented Aug 8, 2017

The cause is break outside of loop (used in the read_gitfile function). Duplicate of #43162. Changing the break to normal return fixes the error.

Reduced:

fn foo() -> bool {
    break true;
}
Stack trace
error[E0601]: main function not found

error[E0268]: `break` outside of loop
 --> 1.rs:2:5
  |
2 |     break true;
  |     ^^^^^^^^^^ cannot break outside of a loop

error: internal compiler error: src/librustc_typeck/check/mod.rs:1988: no type for node 8: expr true (id=8) in fcx 0x700006ca1a38

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.21.0-nightly (ed16b0a1d 2017-08-05) running on x86_64-apple-darwin

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:486:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::panicking::default_hook::{{closure}}
   2: std::panicking::default_hook
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic
   5: rustc_errors::Handler::bug
   6: rustc::session::opt_span_bug_fmt::{{closure}}
   7: rustc::session::opt_span_bug_fmt
   8: rustc::session::bug_fmt
   9: rustc_typeck::check::FnCtxt::node_ty
  10: <rustc_typeck::check::regionck::RegionCtxt<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  11: <rustc_typeck::check::regionck::RegionCtxt<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  12: rustc::hir::intravisit::walk_expr
  13: <rustc_typeck::check::regionck::RegionCtxt<'a, 'gcx, 'tcx> as rustc::hir::intravisit::Visitor<'gcx>>::visit_expr
  14: rustc_typeck::check::regionck::RegionCtxt::visit_fn_body
  15: rustc_typeck::check::typeck_tables_of::{{closure}}
  16: rustc_typeck::check::typeck_tables_of
  17: rustc::dep_graph::graph::DepGraph::with_task
  18: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  19: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_tables_of
  21: rustc_typeck::check::typeck_item_bodies
  22: rustc::dep_graph::graph::DepGraph::with_task
  23: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  24: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  25: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  26: rustc_typeck::check_crate
  27: rustc::ty::context::TyCtxt::create_and_enter
  28: rustc_driver::driver::compile_input
  29: rustc_driver::run_compiler

kennytm added a commit to kennytm/rust that referenced this issue Aug 8, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Aug 10, 2017
@Mark-Simulacrum
Copy link
Member

Closing in favor of #43162.

bors added a commit that referenced this issue Aug 11, 2017
Type-check `break value;` even outside of `loop {}`.

Fix #43162, fix #43727.
dvc94ch pushed a commit to dvc94ch/rust that referenced this issue Nov 20, 2017
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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants