rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.09k stars 12.79k forks source link

No def'n found for DefId { krate: CrateNum(0), node: DefIndex(176) #39607

Closed tupshin closed 7 years ago

tupshin commented 7 years ago

I've been getting this error fairly persistently despite trying to work around it a few ways, so filing this here even though I don't yet have an isolated reproducible case.

stack backtrace:
   1:     0x7f99e823145c - std::sys::imp::backtrace::tracing::imp::write::hf7294f5e24536b4a
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x7f99e823f90e - std::panicking::default_hook::{{closure}}::h9a07d0b00c43fbee
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:351
   3:     0x7f99e823f4b3 - std::panicking::default_hook::hf25feff2d08bf39b
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:361
   4:     0x7f99e823fdab - std::panicking::rust_panic_with_hook::h4cb8c6fbb8386ccf
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:555
   5:     0x7f99e087ae37 - std::panicking::begin_panic::h133cfd00382ed92d
   6:     0x7f99e089051d - rustc_errors::Handler::bug::h0c95eedc3adddeaa
   7:     0x7f99e538d10a - rustc::session::opt_span_bug_fmt::{{closure}}::hb77f1c2804eeb101
   8:     0x7f99e538cbc5 - rustc::session::opt_span_bug_fmt::h6020528146c503fb
   9:     0x7f99e538c822 - rustc::session::bug_fmt::h80c5b006234b3146
  10:     0x7f99e54187e9 - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::impl_trait_ref::h723a544ccabfefd1
  11:     0x7f99e6c9a9ba - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::associated_path_def_to_ty::hcd3a1d566461deb3
  12:     0x7f99e6c9dbcc - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_ty_to_ty::hf1f13e8dab321530
  13:     0x7f99e6c9e037 - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_ty_to_ty::hf1f13e8dab321530
  14:     0x7f99e6caebcc - rustc_typeck::collect::ty_generic_predicates::h508a0ee6976b8127
  15:     0x7f99e6ca12e6 - <rustc_typeck::collect::CollectItemTypesVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item::h30daff41f9f84591
  16:     0x7f99e6ca0762 - rustc_typeck::collect::collect_item_types::h5bfa53ea89c0f123
  17:     0x7f99e6cc82a9 - rustc_typeck::check_crate::h06f4ceb61c7f6528
  18:     0x7f99e85ddf27 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h074ad5edbf4a7db7
  19:     0x7f99e85d0356 - rustc_driver::driver::phase_3_run_analysis_passes::h380fa931cb354859
  20:     0x7f99e85be160 - rustc_driver::driver::compile_input::hab977ae496b3a6f1
  21:     0x7f99e8608a94 - rustc_driver::run_compiler::h81290683db66a63c
  22:     0x7f99e8514ebb - std::panicking::try::do_call::h00942d7a5d04424f
  23:     0x7f99e8248bea - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
  24:     0x7f99e853d122 - <F as alloc::boxed::FnBox<A>>::call_box::hd87f7ab2fccbd670
  25:     0x7f99e823e764 - std::sys::imp::thread::Thread::new::thread_start::hc16926852e47c008
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/liballoc/boxed.rs:624
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys_common/thread.rs:21
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys/unix/thread.rs:84
  26:     0x7f99e0025463 - start_thread
  27:     0x7f99e7f019de - __clone
  28:                0x0 - <unknown>
tupshin commented 7 years ago

I should elaborate and say that I hit this when I attempt to work around https://github.com/rust-lang/rust/issues/20041

tupshin commented 7 years ago

Tiny reproducible test case found:

pub trait Foo<B>: {type B: Foo<B>;}
impl<A> Foo<Self::B> for A   { type B = A; }

On stable compile fails with failed to resolve. Use of undeclared type or moduleSelf``

but on nightly:

error: internal compiler error: /checkout/src/librustc/ty/mod.rs:1889: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(6) => catatonic/b26150dea8d5ed2d7e01758a53ca82f5::{{impl}}[0] } in tcx.impl_trait_refs

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 'Box<Any>', /checkout/src/librustc_errors/lib.rs:417
stack backtrace:
   1:     0x7f3b250bfc6c - std::sys::imp::backtrace::tracing::imp::write::hbb14611794d3841b
                        at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x7f3b250ce25e - std::panicking::default_hook::{{closure}}::h6ed906c7818ac88c
                        at /checkout/src/libstd/panicking.rs:351
   3:     0x7f3b250cde03 - std::panicking::default_hook::h23eeafbf7c1c05c3
                        at /checkout/src/libstd/panicking.rs:361
   4:     0x7f3b250ce6fb - std::panicking::rust_panic_with_hook::hd0067971b6d1240e
                        at /checkout/src/libstd/panicking.rs:545
   5:     0x7f3b1d712fb7 - std::panicking::begin_panic::hc300cc1c3c24c382
   6:     0x7f3b1d72854d - rustc_errors::Handler::bug::h86684df8c5f40d57
   7:     0x7f3b22220eba - rustc::session::opt_span_bug_fmt::{{closure}}::h3ad09996f9e31eb1
   8:     0x7f3b22220cc5 - rustc::session::opt_span_bug_fmt::h4b0bb8c3e1670f11
   9:     0x7f3b22220922 - rustc::session::bug_fmt::h2dbe8dc3b71c81a2
  10:     0x7f3b222ad4b9 - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::impl_trait_ref::h900e5b606ada5d7b
  11:     0x7f3b229068fa - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::associated_path_def_to_ty::hf76c72c0ac489aae
  12:     0x7f3b22909b43 - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_ty_to_ty::h9ff30c990d450a79
  13:     0x7f3b228fcaec - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::create_substs_for_ast_path::{{closure}}::hd03791d22bb2421e
  14:     0x7f3b2282d69d - rustc::ty::subst::<impl rustc::ty::Slice<rustc::ty::subst::Kind<'tcx>>>::fill_item::h237a29bcbae752fb
  15:     0x7f3b228fc645 - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::create_substs_for_ast_path::h82a4170662063c25
  16:     0x7f3b2290020f - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::create_substs_for_ast_trait_ref::h5a9d38af4735e350
  17:     0x7f3b228fff18 - <rustc_typeck::astconv::AstConv<'gcx, 'tcx> + 'o>::ast_path_to_mono_trait_ref::h948d3ba9dce820dc
  18:     0x7f3b2290d440 - <rustc_typeck::collect::CollectItemTypesVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item::h1ab3f3fbeb8eecde
  19:     0x7f3b2290c722 - rustc_typeck::collect::collect_item_types::h62789b6036667a93
  20:     0x7f3b22933fd9 - rustc_typeck::check_crate::h441df7c8151905be
  21:     0x7f3b2546a457 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h7d2a6da150c7eba7
  22:     0x7f3b25461b56 - rustc_driver::driver::phase_3_run_analysis_passes::hb4049a05b492319a
  23:     0x7f3b2544a480 - rustc_driver::driver::compile_input::hf3e3aa4173908b86
  24:     0x7f3b25494e04 - rustc_driver::run_compiler::h8f8d47f1d258a8a6
  25:     0x7f3b253a117b - std::panicking::try::do_call::h206b9daee04f4ea2
  26:     0x7f3b250d753a - __rust_maybe_catch_panic
                        at /checkout/src/libpanic_unwind/lib.rs:98
  27:     0x7f3b253c94f2 - <F as alloc::boxed::FnBox<A>>::call_box::ha024973179acfe4c
  28:     0x7f3b250cd0b4 - std::sys::imp::thread::Thread::new::thread_start::h2c901daa88f3cb32
                        at /checkout/src/liballoc/boxed.rs:640
                        at /checkout/src/libstd/sys_common/thread.rs:21
                        at /checkout/src/libstd/sys/unix/thread.rs:84
  29:     0x7f3b1cebd463 - start_thread
  30:     0x7f3b24d8e9de - __clone
  31:                0x0 - <unknown>
petrochenkov commented 7 years ago

https://github.com/rust-lang/rust/issues/39607#issuecomment-280005051 is a duplicate of https://github.com/rust-lang/rust/issues/39535

tupshin commented 7 years ago

ah yes it is, thanks. closing in favor. in case my original case is different, will reopen