Skip to content

ICE when compiling bad code #20683

@spacejam

Description

@spacejam

My code is certainly broken, but it triggered an ICE. Apologies if this is a duplicate! If the triggering code is useful, I've pushed a branch with the triggering material: https://github.com/spacejam/rust-rocksdb/tree/tan_ICE

rustc 0.13.0-nightly (c7dd3c4d6 2015-01-05 23:51:00 +0000)
binary: rustc
commit-hash: c7dd3c4d69aee1c4ad8cc220c194b176bba2ab62
commit-date: 2015-01-05 23:51:00 +0000
host: x86_64-apple-darwin
release: 0.13.0-nightly

...

   Compiling rocksdb v0.0.2 (file:///Users/tan/code/rust-rocksdb)
     Running `rustc /Users/tan/code/rust-rocksdb/src/lib.rs --crate-name rocksdb --crate-type lib -g -C metadata=6653d8e8924e4f84 -C extra-filename=-6653d8e8924e4f84 --out-dir /Users/tan/code/rust-rocksdb/target --emit=dep-info,link -L /Users/tan/code/rust-rocksdb/target -L /Users/tan/code/rust-rocksdb/target/deps`
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:592:1: 621:2 error: internal compiler error: impl `VtableImpl(impl_def_id=DefId { krate: 0, node: 3108 }:rocksdb::&'a mut MergeOperands<'a>.Iterator, substs=Substs[types=[[];[];[]], regions=[['_#0r];[];[]]], nested=[[];[];[]])` did not contain projection for `Obligation(predicate=<&'a mut rocksdb::MergeOperands<'a> as TraitRef(&'a mut rocksdb::MergeOperands<'a>, core::iter::Iterator)>::Item,depth=0)`
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:592 impl<'a> Iterator for &'a mut MergeOperands<'a> {
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:593     fn next(&mut self) -> Option<&'a [u8]> {
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:594         use std::raw::Slice;
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:595         match self.cursor == self.num_operands {
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:596             true => None,
/Users/tan/code/rust-rocksdb/src/rocksdb.rs:597             false => {
                                                ...
note: the compiler unexpectedly panicked. 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
thread 'rustc' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:123

stack backtrace:
   1:        0x106f7d5e5 - sys::backtrace::write::h98e4664f4f31dc8eiTs
   2:        0x106fa2f4f - failure::on_fail::h15cffea110d6009eKVy
   3:        0x106f0840a - rt::unwind::begin_unwind_inner::h9de529c6f705175fKDy
   4:        0x104c09dc7 - rt::unwind::begin_unwind::h8742058877264024887
   5:        0x104c09d5c - diagnostic::SpanHandler::span_bug::h3bc28b7b3bcff0610kF
   6:        0x1043a1603 - middle::traits::project::project_type::h5ce8ef2558d93d50zQP
   7:        0x10439cb5e - middle::traits::project::opt_normalize_projection_type::hcee84b18f83e8d45CIP
   8:        0x10438ae43 - middle::traits::project::normalize_projection_type::h7c69afde591a893ddHP
   9:        0x10439df9f - middle::traits::project::AssociatedTypeNormalizer<'a, 'b, 'tcx>.TypeFolder<'tcx>::fold_ty::hc4b6ba01061942daOFP
  10:        0x103cab937 - middle::ty_fold::TypeFolder::fold_trait_ref::h6518936090498913440
  11:        0x103cac3a1 - middle::ty_fold::VecPerParamSpace<T>.TypeFoldable<'tcx>::fold_with::h10053445313753109854
  12:        0x103cc73b4 - check::FnCtxt<'a, 'tcx>::instantiate_bounds::h31abbc782f1f47fd1kl
  13:        0x103cdfdfd - check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>::with_fcx::h1819609048976829711
  14:        0x103ce2620 - check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>.Visitor<'v>::visit_item::h2bf7c5e628314514tki
  15:        0x103ce546f - visit::walk_mod::h14492313709251987009
  16:        0x103ce2fac - check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>.Visitor<'v>::visit_item::h2bf7c5e628314514tki
  17:        0x103de546b - check_crate::unboxed_closure.39887
  18:        0x103de0d53 - check_crate::hbc0ab8570a19149famx
  19:        0x103711292 - driver::phase_3_run_analysis_passes::h61da41ec58961d9bSva
  20:        0x1036fdcac - driver::compile_input::h6ba151de4af50ce2vba
  21:        0x1037c0c13 - thunk::F.Invoke<A, R>::invoke::h15890902738341362910
  22:        0x1037bdd70 - rt::unwind::try::try_fn::h15939753852117214544
  23:        0x107008009 - rust_try_inner
  24:        0x107007ff6 - rust_try
  25:        0x1037be4b6 - thunk::F.Invoke<A, R>::invoke::h14011449182044061502
  26:        0x106f8ea34 - sys::thread::thread_start::h4e93ea2350249d53kGv
  27:     0x7fff8dcfa2fc - _pthread_body
  28:     0x7fff8dcfa279 - _pthread_body

Could not compile `rocksdb`.

Caused by:
  Process didn't exit successfully: `rustc /Users/tan/code/rust-rocksdb/src/lib.rs --crate-name rocksdb --crate-type lib -g -C metadata=6653d8e8924e4f84 -C extra-filename=-6653d8e8924e4f84 --out-dir /Users/tan/code/rust-rocksdb/target --emit=dep-info,link -L /Users/tan/code/rust-rocksdb/target -L /Users/tan/code/rust-rocksdb/target/deps` (status=101)

Metadata

Metadata

Assignees

No one assigned

    Labels

    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