Skip to content

ICE: unexpected failure @ middle::typeck::infer::error_reporting::InferCtxt<'a, 'tcx>.ErrorReporting::give_suggestion #17758

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

Closed
emk opened this issue Oct 4, 2014 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@emk
Copy link
Contributor

emk commented Oct 4, 2014

This broken code snippet:

pub trait Nothing<'a> {
    fn nothing(&'a mut self) -> ();

    fn twice_nothing(&mut self) -> () {
        { self.nothing(); }
        { self.nothing(); }
    }
}

Appears to crash the error reporting code:

error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'expect item fn', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/option.rs:315

stack backtrace:
   1:     0x7f58ea22c1a0 - rt::backtrace::imp::write::h09cd946771ab0c0fGGq
   2:     0x7f58ea22f330 - failure::on_fail::h4d3c6393a0c3a65581q
   3:     0x7f58ea9fc510 - unwind::begin_unwind_inner::hacf1a8f1e565f619SUd
   4:     0x7f58ea9fc070 - unwind::begin_unwind_fmt::h080aba0452d8c216kSd
   5:     0x7f58ea9fc030 - rust_begin_unwind
   6:     0x7f58eaa44350 - failure::fail_fmt::hbfb8f595be3564a4oqk
   7:     0x7f58eb4055f0 - middle::typeck::infer::error_reporting::InferCtxt<'a, 'tcx>.ErrorReporting::give_suggestion::he83398a7946440e9tK5
   8:     0x7f58eb3fbfc0 - middle::typeck::infer::error_reporting::InferCtxt<'a, 'tcx>.ErrorReporting::report_processed_errors::hc65a1791d426f721xJ5
   9:     0x7f58eb3f44c0 - middle::typeck::infer::error_reporting::InferCtxt<'a, 'tcx>.ErrorReporting::report_region_errors::h793e1a0eba4d8bac0V4
  10:     0x7f58eb303540 - middle::typeck::infer::InferCtxt<'a, 'tcx>::resolve_regions_and_report_errors::h01a376efbdc61f92the
  11:     0x7f58eb303760 - middle::typeck::check::regionck::regionck_fn::he43dc94f3751ced6hYM
  12:     0x7f58eb349040 - middle::typeck::check::check_bare_fn::ha87adcf3bff90adaxRS
  13:     0x7f58eb3514f0 - middle::typeck::check::check_method_body::h1a37bdcbedcdc1dehuT
  14:     0x7f58eb344e50 - middle::typeck::check::check_item::h767abed1c6c4a34dAjT
  15:     0x7f58eb3472d0 - visit::walk_item::h12207423757898312865
  16:     0x7f58eb348af0 - middle::typeck::check::check_item_types::hf248928e4dabd6b2HQS
  17:     0x7f58eadf3640 - util::common::time::h2616922191819368531
  18:     0x7f58eb626bd0 - middle::typeck::check_crate::h484d4bed9f589896DVk
  19:     0x7f58eb6913f0 - driver::driver::phase_3_run_analysis_passes::h2f79f56e810f6357Ptx
  20:     0x7f58eb68cc00 - driver::driver::compile_input::h73c51e1958276bfeBax
  21:     0x7f58eb70ee90 - driver::run_compiler::h0582589c54a9149bS0A
  22:     0x7f58eb70ed70 - driver::run::closure.147672
  23:     0x7f58eae0c5d0 - task::TaskBuilder<S>::try_future::closure.101696
  24:     0x7f58eae0c3c0 - task::TaskBuilder<S>::spawn_internal::closure.101667
  25:     0x7f58ec036f70 - task::spawn_opts::closure.8474
  26:     0x7f58eaa517d0 - rust_try_inner
  27:     0x7f58eaa517c0 - rust_try
  28:     0x7f58ea9f96a0 - unwind::try::h95b9313d07b2b144AJd
  29:     0x7f58ea9f9530 - task::Task::run::h0a905e55c2a230beUYc
  30:     0x7f58ec036ce0 - task::spawn_opts::closure.8414
  31:     0x7f58ea9fb5b0 - thread::thread_start::hdbeb91d615fae747pjd
  32:     0x7f58e9cf9dc0 - start_thread
  33:                0x0 - <unknown>
@bkoropoff
Copy link
Contributor

Looks like give_suggestion is just missing cases for provided methods in a trait. Should be an easy fix.

bkoropoff added a commit to bkoropoff/rust that referenced this issue Oct 4, 2014
bkoropoff added a commit to bkoropoff/rust that referenced this issue Oct 4, 2014
@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 4, 2014
bors added a commit that referenced this issue Oct 4, 2014
@bkoropoff
Copy link
Contributor

GitHub is confused and doesn't show the PR with the fix as merged, but it was. This bug can be closed.

@alexcrichton
Copy link
Member

Thanks @bkoropoff!

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) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants