Skip to content

ICE on stable 1.26 and nightly 1.27 #50668

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
Swoorup opened this issue May 11, 2018 · 3 comments
Closed

ICE on stable 1.26 and nightly 1.27 #50668

Swoorup opened this issue May 11, 2018 · 3 comments

Comments

@Swoorup
Copy link

Swoorup commented May 11, 2018

For some reason, the following example fails to compile resulting in ICE.

I have tested on the latest stable 1.26 and nightly.

https://play.rust-lang.org/?gist=5cc063593994ef7a0ee52b298c83116b&version=stable&mode=debug

RUST_BACKTRACE=1 output on 1.27 nightly:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: (MoveData { move_paths: [MovePath { place: _0 }, MovePath { place: _1 }, MovePath { place: _2 }, MovePath { place: _3 }, MovePath { place: _4 }, MovePath { place: _5 }, MovePath { place: _6 }, MovePath { place: _7 }, MovePath { place: _8 }], moves: [mp7@bb0[10], mp7@bb2[1], mp4@bb2[2], mp5@bb2[2], mp3@bb3[0], mp5@bb4[0], mp6@bb4[1], mp6@bb5[0], mp6@bb6[0], mp8@bb6[1], mp4@bb6[2], mp3@bb6[3], mp3@bb7[0], mp0@bb7[1]], loc_map: LocationMap { map: [[[], [], [], [], [], [], [], [], [], [], [mo0]], [[]], [[], [mo1], [mo2, mo3]], [[mo4]], [[mo5], [mo6]], [[mo7]], [[mo8], [mo9], [mo10], [mo11]], [[mo12], [mo13]]] }, path_map: [[mo13], [], [], [mo4, mo11, mo12], [mo2, mo10], [mo3, mo5], [mo6, mo7, mo8], [mo0, mo1], [mo9]], rev_lookup: MovePathLookup { locals: [mp0, mp1, mp2, mp3, mp4, mp5, mp6, mp7, mp8], projections: {} }, inits: [[email protected]:9:40: 9:72 (Deep), [email protected]:9:41: 9:48 (Deep), [email protected]:9:46: 9:47 (Deep), [email protected]:9:50: 9:51 (Deep), [email protected]:9:55: 9:60 (Deep), [email protected]:9:55: 9:60 (Deep), [email protected]:9:55: 9:72 (NonPanicPathOnly), [email protected]:9:55: 9:72 (Deep), [email protected]:9:50: 9:72 (NonPanicPathOnly)], init_loc_map: LocationMap { map: [[[], [in2], [], [in3], [], [], [], [], [in4], [in5], [in6]], [[]], [[in7], [], [in8]], [[]], [[], []], [[]], [[], [], [], []], [[], []]] }, init_path_map: [[in8], [in0], [in1], [in2], [in3], [in7], [in6], [in5], [in4]] }, [IllegalMove { cannot_move_out_of: IllegalMoveOrigin { span: ice.rs:9:46: 9:47, kind: BorrowedContent } }])', libcore/result.rs:945:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: <rustc_mir::transform::elaborate_drops::ElaborateDrops as rustc_mir::transform::MirPass>::run_pass
  11: rustc_mir::transform::optimized_mir::{{closure}}
  12: rustc_mir::transform::optimized_mir
  13: rustc::ty::maps::<impl rustc::ty::maps::config::QueryConfig<'tcx> for rustc::ty::maps::queries::optimized_mir<'tcx>>::compute
  14: rustc::dep_graph::graph::DepGraph::with_task_impl
  15: rustc::ty::context::tls::with_related_context
  16: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  17: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  18: rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::instance_mir
  19: rustc_mir::monomorphize::collector::collect_items_rec
  20: rustc_mir::monomorphize::collector::collect_items_rec
  21: rustc_mir::monomorphize::collector::collect_items_rec
  22: rustc_mir::monomorphize::collector::collect_items_rec
  23: rustc_mir::monomorphize::collector::collect_items_rec
  24: rustc_mir::monomorphize::collector::collect_items_rec
  25: rustc_mir::monomorphize::collector::collect_items_rec
  26: rustc_mir::monomorphize::collector::collect_items_rec
  27: rustc_mir::monomorphize::collector::collect_crate_mono_items
  28: rustc::util::common::time
  29: rustc_trans::base::collect_and_partition_translation_items
  30: rustc::dep_graph::graph::DepGraph::with_task_impl
  31: rustc::ty::context::tls::with_related_context
  32: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  33: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  34: rustc_trans::base::trans_crate
  35: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
  36: rustc::util::common::time
  37: rustc_driver::driver::phase_4_translate_to_llvm
  38: rustc_driver::driver::compile_input::{{closure}}
  39: rustc::ty::context::tls::enter_context
  40: <std::thread::local::LocalKey<T>>::with
  41: rustc::ty::context::TyCtxt::create_and_enter
  42: rustc_driver::driver::compile_input
  43: rustc_driver::run_compiler_impl
  44: <scoped_tls::ScopedKey<T>>::set
  45: syntax::with_globals
  46: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  47: __rust_maybe_catch_panic
  48: rustc_driver::run
  49: rustc_driver::main
  50: std::rt::lang_start::{{closure}}
  51: std::panicking::try::do_call
  52: __rust_maybe_catch_panic
  53: std::rt::lang_start_internal
  54: main
query stack during panic:
#0 [optimized_mir] processing `main::{{closure}}`
#1 [collect_and_partition_translation_items] collect_and_partition_translation_items
end of query stack

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: rustc 1.27.0-nightly (acd3871ba 2018-05-10) running on x86_64-apple-darwin

@durka
Copy link
Contributor

durka commented May 11, 2018

Looks like a duplicate of #49534.

@Swoorup
Copy link
Author

Swoorup commented May 11, 2018

Looks like NLL allows the compiler to report the error correctly:

https://play.rust-lang.org/?gist=598a3b5c5359d4b9d72099a20d8219b4&version=nightly&mode=debug

@Swoorup Swoorup changed the title Internal Compiler Bug on Stable and Nightly ICE on stable 1.26 and nightly 1.27 May 12, 2018
@ishitatsuyuki
Copy link
Contributor

Closing this in favour of #49534.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants