Closed
Description
While trying to migrate i32::BYTES
and friends to associated constants I have encountered this ICE. It's caused by some code in libstd, but the precise location is not clear.
The branch reproducing the ICE can be found here: https://github.com/petrochenkov/rust/tree/primod
cc @quantheory
petrochenkov@______________:~/rust$ RUST_BACKTRACE=1 make rustc-stage1
cfg: version 1.1.0-dev (d4cedea80 2015-04-29) (built 2015-04-29)
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: enabling debug assertions (CFG_ENABLE_DEBUG_ASSERTIONS)
cfg: enabling debuginfo (CFG_ENABLE_DEBUGINFO)
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: good valgrind for x86_64-unknown-linux-gnu is 1
cfg: using CC=gcc (CFG_CC)
cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS)
cfg: valgrind-rpass command set to "/usr/bin/valgrind" --error-exitcode=100 --fair-sched=try --quiet --soname-synonyms=somalloc=NONE --suppressions=/home/petrochenkov/rust/src/etc/x86.supp --tool=memcheck --leak-check=full
cfg: no pandoc found, omitting PDF and EPUB docs
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
error: internal compiler error: unexpected panic
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefPrimTy(TyUint(usize)), last_private: LastMod(AllPublic), depth: 1 }', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/librustc/middle/def.rs:81
stack backtrace:
1: 0x2ba1ec043f49 - sys::backtrace::write::h067c01906fdf3adcBYr
2: 0x2ba1ec048926 - panicking::on_panic::h6fb702bb3fef68b4pow
3: 0x2ba1ec025db2 - rt::unwind::begin_unwind_inner::h48266f2af204eb4bz3v
4: 0x2ba1ec026927 - rt::unwind::begin_unwind_fmt::h04658be8f2a38794F2v
5: 0x2ba1eab43d55 - middle::const_eval::eval_const_expr_partial::hea9baa0e05ef4477cki
6: 0x2ba1eab4167b - middle::const_eval::eval_const_expr_partial::hea9baa0e05ef4477cki
7: 0x2ba1eab4107c - middle::const_eval::eval_const_expr_partial::hea9baa0e05ef4477cki
8: 0x2ba1ea952b85 - astconv::ast_ty_to_ty::h97d439ea4783dc9cnSv
9: 0x2ba1ea9d011a - iter::Map<I, F>.Iterator::next::h15925606040031353243
10: 0x2ba1ea9c49ea - collect::convert_struct::hecd7620d2481fe2eTVx
11: 0x2ba1ea9b465d - collect::convert_item::hfde15e9c0c9154957Ax
12: 0x2ba1ea9ba9a2 - visit::walk_item::h8692254520880490375
13: 0x2ba1ea9ba9ad - visit::walk_item::h8692254520880490375
14: 0x2ba1ea9ba9ad - visit::walk_item::h8692254520880490375
15: 0x2ba1ea9fce41 - check_crate::closure.38342
16: 0x2ba1ea9fadfb - check_crate::ha670ea092e3c1178tCC
17: 0x2ba1ea5aca88 - driver::phase_3_run_analysis_passes::hcf43fee03d96b08dtGa
18: 0x2ba1ea58ea30 - driver::compile_input::h2d039586ffa6a9e4Qba
19: 0x2ba1ea646871 - run_compiler::h4f34718c5e17403165b
20: 0x2ba1ea6440c2 - boxed::F.FnBox<A>::call_box::h10040685102554793607
21: 0x2ba1ea643679 - rt::unwind::try::try_fn::h2545211264873891294
22: 0x2ba1ec04de18 - rust_try_inner
23: 0x2ba1ec04de05 - rust_try
24: 0x2ba1ea643920 - boxed::F.FnBox<A>::call_box::h13618416845398747240
25: 0x2ba1ec0477c1 - sys::thread::Thread::new::thread_start::ha1bf268dbc858fc809u
26: 0x2ba1ecd01181 - start_thread
27: 0x2ba1ed93947c - __clone
28: 0x0 - <unknown>