Skip to content

error: internal compiler error: src/librustc/hir/def.rs:265: attempted .def_id() on invalid def #56202

Closed
@TheIronBorn

Description

@TheIronBorn
error: internal compiler error: src/librustc/hir/def.rs:265: attempted .def_id() on invalid def: <err>

thread 'main' panicked at 'Box<Any>', src/librustc_errors/lib.rs:600: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::util::bug::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::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: rustc::hir::def::Def::def_id::{{closure}}
  15: <rustc::middle::reachable::ReachableContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  16: rustc::hir::intravisit::walk_expr
  17: <rustc::middle::reachable::ReachableContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  18: <rustc::middle::reachable::ReachableContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  19: rustc::middle::reachable::reachable_set
  20: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::reachable_set<'tcx>>::compute
  21: rustc::dep_graph::graph::DepGraph::with_task_impl
  22: rustc::ty::context::tls::with_related_context
  23: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  25: rustc_codegen_ssa::back::symbol_export::reachable_non_generics_provider
  26: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::reachable_non_generics<'tcx>>::compute
  27: rustc::dep_graph::graph::DepGraph::with_task_impl
  28: rustc::ty::context::tls::with_related_context
  29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  31: rustc_codegen_ssa::back::symbol_export::exported_symbols_provider_local
  32: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::exported_symbols<'tcx>>::compute
  33: rustc::dep_graph::graph::DepGraph::with_task_impl
  34: rustc::ty::context::tls::with_related_context
  35: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  36: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  37: rustc_metadata::encoder::encode_metadata
  38: rustc_metadata::cstore_impl::<impl rustc::middle::cstore::CrateStore for rustc_metadata::cstore::CStore>::encode_metadata
  39: rustc::ty::context::TyCtxt::encode_metadata
  40: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::write_metadata
  41: rustc::util::common::time
  42: rustc_codegen_ssa::base::codegen_crate
  43: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  44: rustc::util::common::time
  45: rustc_driver::driver::phase_4_codegen
  46: rustc_driver::driver::compile_input::{{closure}}
  47: rustc::ty::context::tls::enter_context
  48: <std::thread::local::LocalKey<T>>::with
  49: rustc::ty::context::TyCtxt::create_and_enter
  50: rustc_driver::driver::compile_input
  51: rustc_driver::run_compiler_with_pool
  52: <scoped_tls::ScopedKey<T>>::set
  53: rustc_driver::run_compiler
  54: syntax::with_globals
  55: __rust_maybe_catch_panic
  56: rustc_driver::run
  57: rustc_driver::main
  58: std::rt::lang_start::{{closure}}
  59: std::panicking::try::do_call
  60: __rust_maybe_catch_panic
  61: std::rt::lang_start_internal
  62: main
query stack during panic:
#0 [reachable_set] reachability
#1 [reachable_non_generics] looking up the exported symbols of a crate
#2 [exported_symbols] exported_symbols
end of query stack
error: aborting due to previous error


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.32.0-nightly (1f57e4841 2018-11-23) running on x86_64-apple-darwin

note: compiler flags: -C opt-level=3 -C target-cpu=native -C lto=thin --crate-type lib

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

error: Could not compile <crate>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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