Skip to content

ICE: rustdoc: local_def_id: no entry for HirId #101076

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

./src/test/ui/macros/auxiliary/issue-75982.rs

const _: () = {
    #[macro_export]
    macro_rules! first_macro {
        () => {}
    }
    mod foo {
        #[macro_export]
        macro_rules! second_macro {
            () => {}
        }
    }
};

Meta

rustdoc --version --verbose:

rustdoc 1.65.0-nightly (c07a8b4e0 2022-08-26)
binary: rustdoc
commit-hash: c07a8b4e09f356c7468b69c50cac7fc5b5000b8a
commit-date: 2022-08-26
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

<output>
Backtrace

error: internal compiler error: /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/compiler/rustc_middle/src/hir/map/mod.rs:200:13: local_def_id: no entry for `HirId { owner: DefId(0:3 ~ issue_75982[4e75]::_), local_id: 2 }`, which has a map of `Some(Stmt(Stmt { hir_id: HirId { owner: DefId(0:3 ~ issue_75982[4e75]::_), local_id: 2 }, kind: Item(ItemId { def_id: DefId(0:4 ~ issue_75982[4e75]::_::first_macro) }), span: ./src/test/ui/macros/auxiliary/issue-75982.rs:3:5: 5:6 (#0) }))`

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/compiler/rustc_errors/src/lib.rs:1453:9
stack backtrace:
   0:     0x7f52d2207520 - std::backtrace_rs::backtrace::libunwind::trace::ha93b1d4802475003
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f52d2207520 - std::backtrace_rs::backtrace::trace_unsynchronized::h40d7f2da011bd85b
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f52d2207520 - std::sys_common::backtrace::_print_fmt::hd4c318607ed6977d
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f52d2207520 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3d1dee5bf49c390e
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f52d226224e - core::fmt::write::h5629927f37465513
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f52d21f81b5 - std::io::Write::write_fmt::h41e38f576096734b
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/io/mod.rs:1672:15
   6:     0x7f52d220a1e3 - std::sys_common::backtrace::_print::hb4df1a69959f2fbc
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f52d220a1e3 - std::sys_common::backtrace::print::h7093396eb4e737fc
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f52d220a1e3 - std::panicking::default_hook::{{closure}}::h044155a56acd855d
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:295:22
   9:     0x7f52d2209ecf - std::panicking::default_hook::hf2b314c3c2ce4158
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:314:9
  10:     0x7f52d4a38cd1 - rustc_driver[5c6f06715f70ec5d]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f52d220aa1d - std::panicking::rust_panic_with_hook::he1240b7f7e10f2ad
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/panicking.rs:702:17
  12:     0x7f52d59bf291 - std[f534759d154ebe3c]::panicking::begin_panic::<rustc_errors[796597d4f3161658]::ExplicitBug>::{closure#0}
  13:     0x7f52d59bddc6 - std[f534759d154ebe3c]::sys_common::backtrace::__rust_end_short_backtrace::<std[f534759d154ebe3c]::panicking::begin_panic<rustc_errors[796597d4f3161658]::ExplicitBug>::{closure#0}, !>
  14:     0x7f52d59a7d06 - std[f534759d154ebe3c]::panicking::begin_panic::<rustc_errors[796597d4f3161658]::ExplicitBug>
  15:     0x7f52d59e1fb6 - std[f534759d154ebe3c]::panic::panic_any::<rustc_errors[796597d4f3161658]::ExplicitBug>
  16:     0x7f52d59e15dd - <rustc_errors[796597d4f3161658]::HandlerInner>::bug::<&alloc[4886e805f51c44d9]::string::String>
  17:     0x7f52d59e1330 - <rustc_errors[796597d4f3161658]::Handler>::bug::<&alloc[4886e805f51c44d9]::string::String>
  18:     0x7f52d5a0bffd - rustc_middle[add6c9fd911342e9]::ty::context::tls::with_context_opt::<rustc_middle[add6c9fd911342e9]::ty::context::tls::with_opt<rustc_middle[add6c9fd911342e9]::util::bug::opt_span_bug_fmt<rustc_span[50cd62b67dc70a93]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7f52d5a0dde6 - rustc_middle[add6c9fd911342e9]::util::bug::opt_span_bug_fmt::<rustc_span[50cd62b67dc70a93]::span_encoding::Span>
  20:     0x7f52d342aa73 - rustc_middle[add6c9fd911342e9]::util::bug::bug_fmt
  21:     0x55e0237ef220 - <rustc_middle[add6c9fd911342e9]::hir::map::Map>::local_def_id
  22:     0x55e0238130e0 - <rustdoc[2786000975122eb4]::passes::propagate_doc_cfg::CfgPropagator as rustdoc[2786000975122eb4]::fold::DocFolder>::fold_item
  23:     0x55e0237c0547 - <alloc[4886e805f51c44d9]::vec::Vec<rustdoc[2786000975122eb4]::clean::types::Item> as alloc[4886e805f51c44d9]::vec::spec_from_iter::SpecFromIter<rustdoc[2786000975122eb4]::clean::types::Item, core[11ae8b9faed64a6a]::iter::adapters::filter_map::FilterMap<alloc[4886e805f51c44d9]::vec::into_iter::IntoIter<rustdoc[2786000975122eb4]::clean::types::Item>, <rustdoc[2786000975122eb4]::passes::propagate_doc_cfg::CfgPropagator as rustdoc[2786000975122eb4]::fold::DocFolder>::fold_inner_recur::{closure#1}>>>::from_iter
  24:     0x55e0238010ac - <rustdoc[2786000975122eb4]::passes::propagate_doc_cfg::CfgPropagator as rustdoc[2786000975122eb4]::fold::DocFolder>::fold_inner_recur
  25:     0x55e02381342b - <rustdoc[2786000975122eb4]::passes::propagate_doc_cfg::CfgPropagator as rustdoc[2786000975122eb4]::fold::DocFolder>::fold_item
  26:     0x55e023812655 - rustdoc[2786000975122eb4]::passes::propagate_doc_cfg::propagate_doc_cfg
  27:     0x55e0238c6acd - <rustc_session[248254b91735aa9a]::session::Session>::time::<rustdoc[2786000975122eb4]::clean::types::Crate, rustdoc[2786000975122eb4]::core::run_global_ctxt::{closure#8}>
  28:     0x55e02374916f - rustdoc[2786000975122eb4]::core::run_global_ctxt
  29:     0x55e0238c6daf - <rustc_session[248254b91735aa9a]::session::Session>::time::<(rustdoc[2786000975122eb4]::clean::types::Crate, rustdoc[2786000975122eb4]::config::RenderOptions, rustdoc[2786000975122eb4]::formats::cache::Cache), rustdoc[2786000975122eb4]::main_options::{closure#0}::{closure#0}::{closure#1}::{closure#0}>
  30:     0x55e0237d5e41 - <rustc_interface[72ffc69696572c14]::passes::QueryContext>::enter::<rustdoc[2786000975122eb4]::main_options::{closure#0}::{closure#0}::{closure#1}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  31:     0x55e0236fec0a - <rustc_interface[72ffc69696572c14]::interface::Compiler>::enter::<rustdoc[2786000975122eb4]::main_options::{closure#0}::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  32:     0x55e02391fa40 - rustc_span[50cd62b67dc70a93]::with_source_map::<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustc_interface[72ffc69696572c14]::interface::create_compiler_and_run<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustdoc[2786000975122eb4]::main_options::{closure#0}>::{closure#1}>
  33:     0x55e02372afbe - rustc_interface[72ffc69696572c14]::interface::create_compiler_and_run::<core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>, rustdoc[2786000975122eb4]::main_options::{closure#0}>
  34:     0x55e02361ca16 - rustdoc[2786000975122eb4]::main_options
  35:     0x55e0237d3b0c - <scoped_tls[35f9cd4d9e5ad004]::ScopedKey<rustc_span[50cd62b67dc70a93]::SessionGlobals>>::set::<rustdoc[2786000975122eb4]::main_args::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  36:     0x55e023894490 - std[f534759d154ebe3c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[72ffc69696572c14]::util::run_in_thread_pool_with_globals<rustdoc[2786000975122eb4]::main_args::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>
  37:     0x55e02372fb48 - <<std[f534759d154ebe3c]::thread::Builder>::spawn_unchecked_<rustc_interface[72ffc69696572c14]::util::run_in_thread_pool_with_globals<rustdoc[2786000975122eb4]::main_args::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>::{closure#0}, core[11ae8b9faed64a6a]::result::Result<(), rustc_errors[796597d4f3161658]::ErrorGuaranteed>>::{closure#1} as core[11ae8b9faed64a6a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f52d2214643 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4ef6136079acdd61
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/alloc/src/boxed.rs:1940:9
  39:     0x7f52d2214643 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc9c7585f1bc6dc48
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/alloc/src/boxed.rs:1940:9
  40:     0x7f52d2214643 - std::sys::unix::thread::Thread::new::thread_start::h42bde6fadc2c36dd
                               at /rustc/c07a8b4e09f356c7468b69c50cac7fc5b5000b8a/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7f52d1f5278d - <unknown>
  42:     0x7f52d1fd38e4 - clone
  43:                0x0 - <unknown>

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.65.0-nightly (c07a8b4e0 2022-08-26) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to previous error

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions