Repository: rust
Issue: regression: ICE: thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:1501:75
Labels: T-rustdoc,I-ICE,T-compiler,regression-from-stable-to-stable,C-bug,I-prioritize

A few rustdoc results in crater have the same backtrace:

1. https://crater-reports.s3.amazonaws.com/beta-rustdoc-1.84.0-4-retry/beta-2024-12-08/reg/conflagrate-0.1.0/log.txt
2. https://crater-reports.s3.amazonaws.com/beta-rustdoc-1.84.0-4-retry/beta-2024-12-08/reg/ink-5.1.1/log.txt
3. https://crater-reports.s3.amazonaws.com/beta-rustdoc-1.84.0-4-retry/beta-2024-12-08/reg/perigee-0.7.0/log.txt

### Meta

Using rustc 1.84.0-beta.4 in crater https://github.com/rust-lang/rust/issues/134138.

### Error output

```
[INFO] [stderr] thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:1501:75:
[INFO] [stderr] called `Option::unwrap()` on a `None` value
```

<details><summary><strong>Backtrace</strong></summary>
<p>

```
[INFO] [stderr] stack backtrace:
[INFO] [stderr]    0:     0x78dc8929152a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h98c26ac25ffe89bb
[INFO] [stderr]    1:     0x78dc89a248fc - core::fmt::write::h0dd5f6e2238c7982
[INFO] [stderr]    2:     0x78dc8a94ffd1 - std::io::Write::write_fmt::hc00bff0a88e08857
[INFO] [stderr]    3:     0x78dc89291382 - std::sys::backtrace::BacktraceLock::print::h5c19c1c038ee186d
[INFO] [stderr]    4:     0x78dc8929385a - std::panicking::default_hook::{{closure}}::h77172f079a1fcb13
[INFO] [stderr]    5:     0x78dc892936c0 - std::panicking::default_hook::he5f8e3b203ccddba
[INFO] [stderr]    6:     0x78dc883108b5 - std[b9e7ca495922dc28]::panicking::update_hook::<alloc[a74230b4a4ddab6d]::boxed::Box<rustc_driver_impl[a84ad889800babb7]::install_ice_hook::{closure#0}>>::{closure#0}
[INFO] [stderr]    7:     0x78dc89293f38 - std::panicking::rust_panic_with_hook::h53863d4e9018df39
[INFO] [stderr]    8:     0x78dc89293cd6 - std::panicking::begin_panic_handler::{{closure}}::h67280e6fa0757873
[INFO] [stderr]    9:     0x78dc892919d9 - std::sys::backtrace::__rust_end_short_backtrace::h1dac3f54d6fbbeb2
[INFO] [stderr]   10:     0x78dc892939cc - rust_begin_unwind
[INFO] [stderr]   11:     0x78dc85cee560 - core::panicking::panic_fmt::h6792bd1b2bf01041
[INFO] [stderr]   12:     0x78dc85fa057c - core::panicking::panic::hbb5c236a846c507c
[INFO] [stderr]   13:     0x78dc86d490a9 - core::option::unwrap_failed::hc5b7b0e3b50bafe9
[INFO] [stderr]   14:     0x78dc8a772a10 - <rustc_metadata[ab9baa4e98ff82a5]::creader::CrateMetadataRef>::def_key
[INFO] [stderr]   15:     0x78dc8a772342 - <rustc_metadata[ab9baa4e98ff82a5]::creader::CStore as rustc_session[b2ed5a1fdb1e5dc3]::cstore::CrateStore>::def_path
[INFO] [stderr]   16:     0x78dc8a7721f8 - <rustc_middle[bd74a45dc8a6aeec]::ty::context::TyCtxt>::def_path
[INFO] [stderr]   17:     0x78dc889b6199 - <rustc_middle[bd74a45dc8a6aeec]::ty::context::TyCtxt>::def_path_debug_str
[INFO] [stderr]   18:     0x78dc887f7e8d - rustc_interface[164bca52f843a547]::callbacks::def_id_debug
[INFO] [stderr]   19:     0x78dc89a248fc - core::fmt::write::h0dd5f6e2238c7982
[INFO] [stderr]   20:     0x78dc89a248fc - core::fmt::write::h0dd5f6e2238c7982
[INFO] [stderr]   21:     0x78dc89a24760 - alloc::fmt::format::format_inner::h09cb60e85cf9218c
[INFO] [stderr]   22:     0x78dc889ce33b - rustc_middle[bd74a45dc8a6aeec]::util::bug::opt_span_bug_fmt::<rustc_span[84c8ca3d0b382817]::span_encoding::Span>::{closure#0}
[INFO] [stderr]   23:     0x78dc889b58fa - rustc_middle[bd74a45dc8a6aeec]::ty::context::tls::with_opt::<rustc_middle[bd74a45dc8a6aeec]::util::bug::opt_span_bug_fmt<rustc_span[84c8ca3d0b382817]::span_encoding::Span>::{closure#0}, !>::{closure#0}
[INFO] [stderr]   24:     0x78dc889b578b - rustc_middle[bd74a45dc8a6aeec]::ty::context::tls::with_context_opt::<rustc_middle[bd74a45dc8a6aeec]::ty::context::tls::with_opt<rustc_middle[bd74a45dc8a6aeec]::util::bug::opt_span_bug_fmt<rustc_span[84c8ca3d0b382817]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
[INFO] [stderr]   25:     0x78dc86ae9f60 - rustc_middle[bd74a45dc8a6aeec]::util::bug::bug_fmt
[INFO] [stderr]   26:     0x78dc8891e4af - <rustc_metadata[ab9baa4e98ff82a5]::creader::CrateMetadataRef>::missing
[INFO] [stderr]   27:     0x78dc89c13763 - rustc_query_impl[8969a7b8ce30dc91]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8969a7b8ce30dc91]::query_impl::def_kind::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bd74a45dc8a6aeec]::query::erase::Erased<[u8; 3usize]>>
[INFO] [stderr]   28:     0x78dc89c12833 - rustc_query_system[bc50a602aa0ddde9]::query::plumbing::try_execute_query::<rustc_query_impl[8969a7b8ce30dc91]::DynamicConfig<rustc_query_system[bc50a602aa0ddde9]::query::caches::DefIdCache<rustc_middle[bd74a45dc8a6aeec]::query::erase::Erased<[u8; 3usize]>>, false, false, false>, rustc_query_impl[8969a7b8ce30dc91]::plumbing::QueryCtxt, false>
[INFO] [stderr]   29:     0x78dc89c1254f - rustc_query_impl[8969a7b8ce30dc91]::query_impl::def_kind::get_query_non_incr::__rust_end_short_backtrace
[INFO] [stderr]   30:     0x61e7f64f6b4e - rustc_middle[bd74a45dc8a6aeec]::query::plumbing::query_get_at::<rustc_query_system[bc50a602aa0ddde9]::query::caches::DefIdCache<rustc_middle[bd74a45dc8a6aeec]::query::erase::Erased<[u8; 3usize]>>>
[INFO] [stderr]   31:     0x61e7f6570412 - <alloc[a74230b4a4ddab6d]::vec::Vec<(rustdoc[bef8b17de71f3e2]::passes::collect_intra_doc_links::Res, core[d10bf40c8679dc2f]::option::Option<rustdoc[bef8b17de71f3e2]::passes::collect_intra_doc_links::UrlFragment>)>>::retain::<<rustdoc[bef8b17de71f3e2]::passes::collect_intra_doc_links::LinkCollector>::resolve_ambiguities::{closure#0}>::{closure#0}
[INFO] [stderr]   32:     0x61e7f66d2d20 - rustdoc[bef8b17de71f3e2]::core::run_global_ctxt
[INFO] [stderr]   33:     0x61e7f67fe47d - rustdoc[bef8b17de71f3e2]::main_args::{closure#2}::{closure#0}::{closure#0}
[INFO] [stderr]   34:     0x61e7f6576f34 - rustc_interface[164bca52f843a547]::interface::run_compiler::<core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>, rustdoc[bef8b17de71f3e2]::main_args::{closure#2}>::{closure#1}
[INFO] [stderr]   35:     0x61e7f64f3765 - std[b9e7ca495922dc28]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[164bca52f843a547]::util::run_in_thread_with_globals<rustc_interface[164bca52f843a547]::util::run_in_thread_pool_with_globals<rustc_interface[164bca52f843a547]::interface::run_compiler<core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>, rustdoc[bef8b17de71f3e2]::main_args::{closure#2}>::{closure#1}, core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>>::{closure#0}, core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>>
[INFO] [stderr]   36:     0x61e7f6585aec - <<std[b9e7ca495922dc28]::thread::Builder>::spawn_unchecked_<rustc_interface[164bca52f843a547]::util::run_in_thread_with_globals<rustc_interface[164bca52f843a547]::util::run_in_thread_pool_with_globals<rustc_interface[164bca52f843a547]::interface::run_compiler<core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>, rustdoc[bef8b17de71f3e2]::main_args::{closure#2}>::{closure#1}, core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>>::{closure#0}, core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d10bf40c8679dc2f]::result::Result<(), rustc_span[84c8ca3d0b382817]::ErrorGuaranteed>>::{closure#1} as core[d10bf40c8679dc2f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
[INFO] [stderr]   37:     0x78dc8a9328f9 - std::sys::pal::unix::thread::Thread::new::thread_start::h48cf765408f6f5f2
[INFO] [stderr]   38:     0x78dc84a6bac3 - <unknown>
[INFO] [stderr]   39:     0x78dc84afca04 - clone
[INFO] [stderr]   40:                0x0 - <unknown>
[INFO] [stderr] 
[INFO] [stderr] error: the compiler unexpectedly panicked. this is a bug.
[INFO] [stderr] 
[INFO] [stderr] note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md
[INFO] [stderr] 
[INFO] [stderr] note: rustc 1.84.0-beta.4 (202008a1b 2024-12-07) running on x86_64-unknown-linux-gnu
[INFO] [stderr] 
[INFO] [stderr] note: compiler flags: --crate-type lib
[INFO] [stderr] 
[INFO] [stderr] note: some of the compiler flags provided by cargo are hidden
[INFO] [stderr] 
[INFO] [stderr] query stack during panic:
[INFO] [stderr] panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:1499:14:
[INFO] [stderr] lock was already held
[INFO] [stderr] thread panicked while processing panic. aborting.
```

</p>
</details>