Skip to content

Internal compiler error librustc/ty/layout.rs:1627:25 #50371

Closed
@eun-ice

Description

@eun-ice

I cannot isolate what exactly makes rustc crash, but I get an internal compiler error on Mac OSX and Linux.

The code compiles fine with an older nightly:

rustc 1.25.0-nightly (5313e8728 2018-02-17)
binary: rustc
commit-hash: 5313e8728f028cb7914f3c9f02804158a5732b52
commit-date: 2018-02-17
host: x86_64-apple-darwin
release: 1.25.0-nightly
LLVM version: 6.0

But it doesn't work with the current nightly:

rustc 1.27.0-nightly (79252ff4e 2018-04-29)
binary: rustc
commit-hash: 79252ff4e25d82f9fe856cb66f127b79cdace163
commit-date: 2018-04-29
host: x86_64-apple-darwin
release: 1.27.0-nightly
LLVM version: 6.0

The error is

INFO 2018-05-01T16:07:59Z: rustc_trans::base: trans_instance(std::ptr::read_volatile::<std::option::Option<std::collections::VecDeque<iobytes::IoBytes>>>)
INFO 2018-05-01T16:07:59Z: rustc_trans::base: trans_instance(std::ptr::read_volatile::<std::option::Option<usize>>)
INFO 2018-05-01T16:07:59Z: rustc_trans::base: trans_instance(std::ptr::read_volatile::<std::option::Option<metalio::mio_shared::MioEventloopMessage>>)
INFO 2018-05-01T16:07:59Z: rustc_trans::base: trans_instance(std::ptr::write_volatile::<std::option::Option<usize>>)
thread 'main' panicked at 'assertion failed: `(left == right)`
 left: `1`,
right: `0`', librustc/ty/layout.rs:1627:25
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: rustc::ty::layout::<impl rustc_target::abi::TyLayoutMethods<'tcx, C> for &'tcx rustc::ty::TyS<'tcx>>::field
  8: rustc_trans::mir::place::PlaceRef::project_field
  9: rustc_trans::intrinsic::trans_intrinsic_call
 10: rustc_trans::mir::block::<impl rustc_trans::mir::FunctionCx<'a, 'tcx>>::trans_terminator
 11: rustc_trans::mir::trans_mir
 12: rustc_trans::base::trans_instance
 13: rustc_trans::trans_item::MonoItemExt::define
 14: rustc_trans::base::compile_codegen_unit
 15: rustc::ty::maps::<impl rustc::ty::maps::config::QueryConfig<'tcx> for rustc::ty::maps::queries::compile_codegen_unit<'tcx>>::compute
 16: rustc::dep_graph::graph::DepGraph::with_task_impl
 17: rustc::ty::context::tls::with_related_context
 18: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
 19: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
 20: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::compile_codegen_unit
 21: rustc_trans::base::trans_crate
 22: <rustc_trans::LlvmTransCrate as rustc_trans_utils::trans_crate::TransCrate>::trans_crate
 23: rustc::util::common::time
 24: rustc_driver::driver::phase_4_translate_to_llvm
 25: rustc_driver::driver::compile_input::{{closure}}
 26: rustc::ty::context::tls::enter_context
 27: <std::thread::local::LocalKey<T>>::with
 28: rustc::ty::context::TyCtxt::create_and_enter
 29: rustc_driver::driver::compile_input
 30: rustc_driver::run_compiler_impl
 31: <scoped_tls::ScopedKey<T>>::set
 32: syntax::with_globals
 33: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
 34: __rust_maybe_catch_panic
 35: rustc_driver::run
 36: rustc_driver::main
 37: std::rt::lang_start::{{closure}}
 38: std::panicking::try::do_call
 39: __rust_maybe_catch_panic
 40: std::rt::lang_start_internal
 41: main
query stack during panic:
#0 [compile_codegen_unit] compile_codegen_unit
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 (79252ff4e 2018-04-29) running on x86_64-apple-darwin

note: compiler flags: -C opt-level=3 --crate-type lib

note: some of the compiler flags provided by cargo are hidden


Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions