Skip to content

Compiler crash during monomorphization #53468

Closed
@hrvolapeter

Description

@hrvolapeter

Compiler crashes with: Cannot create local mono-item for DefId(134/0:1418 ~ script[8 738]::dom[0]::bindings[0]::interface[0]::invalid_constructor[0])

This minimal example ICEs. This same bug also occurs in https://github.com/retep007/servo-1/tree/ice

Meta

Version: rustc 1.29.0-nightly (1ecf6929d 2018-07-16) running on x86_64-apple-darwin
Compiler flags: -C debuginfo=2 --crate-type lib

Backtrace:

Expandable

Thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:554:9
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
   7: rustc_errors::Handler::bug
   8: rustc::session::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::session::opt_span_bug_fmt
  13: rustc::session::bug_fmt
  14: rustc_mir::monomorphize::collector::should_monomorphize_locally
  15: rustc_mir::monomorphize::collector::collect_miri
  16: rustc_mir::monomorphize::collector::collect_miri
  17: rustc_mir::monomorphize::collector::collect_const
  18: rustc_mir::monomorphize::collector::collect_items_rec
  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_items_rec
  28: rustc_mir::monomorphize::collector::collect_items_rec
  29: rustc_mir::monomorphize::collector::collect_items_rec
  30: rustc_mir::monomorphize::collector::collect_items_rec
  31: rustc_mir::monomorphize::collector::collect_items_rec
  32: rustc_mir::monomorphize::collector::collect_items_rec
  33: rustc_mir::monomorphize::collector::collect_items_rec
  34: rustc_mir::monomorphize::collector::collect_items_rec
  35: rustc_mir::monomorphize::collector::collect_items_rec
  36: rustc_mir::monomorphize::collector::collect_items_rec
  37: rustc_mir::monomorphize::collector::collect_items_rec
  38: rustc_mir::monomorphize::collector::collect_items_rec
  39: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  40: rustc::util::common::time
41: rustc_mir::monomorphize::collector::collect_crate_mono_items
  42: rustc::util::common::time
  43: rustc_codegen_llvm::base::collect_and_partition_mono_items
  44: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_it
ems<'tcx>>::compute
  45: rustc::dep_graph::graph::DepGraph::with_task_impl
  46: rustc::ty::context::tls::with_related_context
  47: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  48: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  49: rustc_codegen_llvm::back::symbol_export::exported_symbols_provider_local
  50: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::exported_symbols<'tcx>>::comp
ute
  51: rustc::dep_graph::graph::DepGraph::with_task_impl
  52: rustc::ty::context::tls::with_related_context
  53: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  54: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  55: rustc_metadata::encoder::encode_metadata
  56: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::encode_metadata
  57: rustc::ty::context::TyCtxt::encode_metadata
  58: rustc_codegen_llvm::base::write_metadata
  59: rustc::util::common::time
  60: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  61: rustc::util::common::time
  62: rustc_driver::driver::phase_4_codegen
  63: rustc_driver::driver::compile_input::{{closure}}
  64: rustc::ty::context::tls::enter_context
  65: <std::thread::local::LocalKey<T>>::with
  66: rustc::ty::context::TyCtxt::create_and_enter
  67: rustc_driver::driver::compile_input
  68: rustc_driver::run_compiler_with_pool
  69: <scoped_tls::ScopedKey<T>>::set
  70: <scoped_tls::ScopedKey<T>>::set
  71: syntax::with_globals
  72: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  73: __rust_maybe_catch_panic
  74: rustc_driver::run
  75: rustc_driver::main
  76: std::rt::lang_start::{{closure}}
  77: std::panicking::try::do_call
  78: __rust_maybe_catch_panic
  79: std::rt::lang_start_internal
  80: main

EDIT: added link to minimal example

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions