Skip to content

ICE when cargo doc on lexical-core: attempted .def_id() on invalid res: Err #64705

Closed
@Evrey

Description

@Evrey

I tried this code: Running cargo doc on a project that has lexical-core 0.6.2 as its direct or indirect dependency.

I expected to see this happen: All packages documented.

Instead, this happened: error: internal compiler error: src/librustc/hir/def.rs:345: attempted .def_id() on invalid res: Err — also fails on docs.rs.

Meta

rustc --version --verbose:

rustc 1.39.0-nightly (1dd188489 2019-09-22)
binary: rustc
commit-hash: 1dd1884891636d0eb51157d137230076bcf20627
commit-date: 2019-09-22
host: x86_64-unknown-linux-gnu
release: 1.39.0-nightly
LLVM version: 9.0

Does also happen for older nightlies, though I forgot to capture the versions before updating in hope it'd fix the issue. There are more ICE issues pointing at def.rs, but none on this line here.

Backtrace:

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:643:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:473
  11: std::panicking::begin_panic
  12: rustc_errors::Handler::bug
  13: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  14: rustc::ty::context::tls::with_opt::{{closure}}
  15: rustc::ty::context::tls::with_context_opt
  16: rustc::ty::context::tls::with_opt
  17: rustc::util::bug::opt_span_bug_fmt
  18: rustc::util::bug::bug_fmt
  19: rustc::hir::def::Res<Id>::def_id::{{closure}}
  20: rustdoc::clean::register_res
  21: <syntax::source_map::Spanned<rustc::hir::VisibilityKind> as rustdoc::clean::Clean<core::option::Option<rustdoc::clean::Visibility>>>::clean
  22: <rustc::hir::ImplItem as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  23: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
  24: <rustdoc::doctree::Impl as rustdoc::clean::Clean<alloc::vec::Vec<rustdoc::clean::Item>>>::clean
  25: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
  26: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  27: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  28: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  29: <rustdoc::doctree::Module as rustdoc::clean::Clean<rustdoc::clean::Item>>::clean
  30: rustdoc::clean::krate
  31: rustc::ty::context::tls::enter_global
  32: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  33: rustc_interface::passes::create_global_ctxt::{{closure}}
  34: rustc_interface::passes::BoxedGlobalCtxt::enter
  35: rustc_interface::interface::run_compiler_in_existing_thread_pool
  36: rustdoc::core::run_core
  37: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  38: std::panicking::try::do_call
  39: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  40: rustc_driver::catch_fatal_errors
  41: rustdoc::main_options
  42: std::thread::local::LocalKey<T>::with
  43: scoped_tls::ScopedKey<T>::set
  44: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: aborting due to previous error

Metadata

Metadata

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyC-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.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions