Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc ICE: no resolutions for a doc link #108378

Closed
clubby789 opened this issue Feb 23, 2023 · 3 comments · Fixed by #109266
Closed

rustdoc ICE: no resolutions for a doc link #108378

clubby789 opened this issue Feb 23, 2023 · 3 comments · Fixed by #109266
Assignees
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@clubby789
Copy link
Contributor

clubby789 commented Feb 23, 2023

Found while reducing #108334, but the error is different (probably same root cause however)

Code

mod m {
    pub enum ValueEnum {} // Also occurs for trait, struct
}
/// [`ValueEnum`]
pub use m::ValueEnum;

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (4507fdaaa 2023-02-18)
binary: rustc
commit-hash: 4507fdaaa27ea2fb59a41df2ce7d1f290da53dae
commit-date: 2023-02-18
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

Backtrace

 Documenting notclap v0.1.0 (/tmp/notclap)
thread 'rustc' panicked at 'no resolutions for a doc link', compiler/rustc_metadata/src/rmeta/encoder.rs:2238:18
stack backtrace:
   0:     0x7f52384b0a7a - std::backtrace_rs::backtrace::libunwind::trace::h9ab7cd28287cf18f
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f52384b0a7a - std::backtrace_rs::backtrace::trace_unsynchronized::h3e7e6ca06d1d63cf
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f52384b0a7a - std::sys_common::backtrace::_print_fmt::h5b6184fd459f0c71
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f52384b0a7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8ed5468732b78071
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f52385109fe - core::fmt::write::h89c1e855e81d7a96
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f52384a0f25 - std::io::Write::write_fmt::ha23ba71db044374b
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/io/mod.rs:1684:15
   6:     0x7f52384b0845 - std::sys_common::backtrace::_print::h194cdf55c322d5fe
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f52384b0845 - std::sys_common::backtrace::print::h4549e75783bab124
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f52384b35bf - std::panicking::default_hook::{{closure}}::h04a46ea9ff60bf2c
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/panicking.rs:267:22
   9:     0x7f52384b32fb - std::panicking::default_hook::h6f3c116d48f73fba
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/panicking.rs:286:9
  10:     0x7f523723c5f5 - <rustc_driver_impl[48a98004e06292cf]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[69c2f5c35675f1ee]::ops::function::FnOnce<(&core[69c2f5c35675f1ee]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f52384b3dfd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h779d28c2deb011a8
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/alloc/src/boxed.rs:2002:9
  12:     0x7f52384b3dfd - std::panicking::rust_panic_with_hook::h5a936503487f19f5
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/panicking.rs:692:13
  13:     0x7f52384b3b79 - std::panicking::begin_panic_handler::{{closure}}::hf8db4efce7a7f23f
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/panicking.rs:579:13
  14:     0x7f52384b0ee6 - std::sys_common::backtrace::__rust_end_short_backtrace::h668cb6dbbf3929c2
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f52384b3882 - rust_begin_unwind
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/panicking.rs:575:5
  16:     0x7f523850d3a3 - core::panicking::panic_fmt::h6a86232234ce2127
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/core/src/panicking.rs:64:14
  17:     0x7f523850d511 - core::panicking::panic_display::h37afa093fa4d76ea
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/core/src/panicking.rs:147:5
  18:     0x7f523850d4bb - core::panicking::panic_str::he2f729466f8303c4
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/core/src/panicking.rs:131:5
  19:     0x7f523850d126 - core::option::expect_failed::hc07db22650c2c2bd
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/core/src/option.rs:1926:5
  20:     0x7f52376e1b67 - <rustc_metadata[857d442a14fe0f98]::rmeta::encoder::provide::{closure#0} as core[69c2f5c35675f1ee]::ops::function::FnOnce<(rustc_middle[2a277d44e6a99f4f]::ty::context::TyCtxt, rustc_span[97beb3ced854c2e2]::def_id::DefId)>>::call_once
  21:     0x7f5237b0a56a - rustc_query_system[46560f6823c6ac3e]::query::plumbing::try_execute_query::<rustc_query_impl[34788ad4354c9a05]::queries::doc_link_resolutions, rustc_query_impl[34788ad4354c9a05]::plumbing::QueryCtxt>
  22:     0x7f5237b2e9d3 - rustc_query_system[46560f6823c6ac3e]::query::plumbing::get_query::<rustc_query_impl[34788ad4354c9a05]::queries::doc_link_resolutions, rustc_query_impl[34788ad4354c9a05]::plumbing::QueryCtxt, rustc_middle[2a277d44e6a99f4f]::dep_graph::dep_node::DepKind>
  23:     0x55c117eef7d8 - <rustdoc[14416492b31d7028]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  24:     0x55c117eefa8e - <rustdoc[14416492b31d7028]::passes::collect_intra_doc_links::LinkCollector>::resolve
  25:     0x55c117ef3be9 - <rustdoc[14416492b31d7028]::passes::collect_intra_doc_links::LinkCollector as rustdoc[14416492b31d7028]::visit::DocVisitor>::visit_item
  26:     0x55c117efc63a - <rustdoc[14416492b31d7028]::passes::collect_intra_doc_links::LinkCollector as rustdoc[14416492b31d7028]::visit::DocVisitor>::visit_inner_recur
  27:     0x55c117ef6a70 - <rustdoc[14416492b31d7028]::passes::collect_intra_doc_links::LinkCollector as rustdoc[14416492b31d7028]::visit::DocVisitor>::visit_item
  28:     0x55c117eee3cf - rustdoc[14416492b31d7028]::passes::collect_intra_doc_links::collect_intra_doc_links
  29:     0x55c117e5f8fe - <rustc_session[403a5d4fc02438c2]::session::Session>::time::<rustdoc[14416492b31d7028]::clean::types::Crate, rustdoc[14416492b31d7028]::core::run_global_ctxt::{closure#7}>
  30:     0x55c117faddbc - rustdoc[14416492b31d7028]::core::run_global_ctxt
  31:     0x55c117e5fb89 - <rustc_session[403a5d4fc02438c2]::session::Session>::time::<(rustdoc[14416492b31d7028]::clean::types::Crate, rustdoc[14416492b31d7028]::config::RenderOptions, rustdoc[14416492b31d7028]::formats::cache::Cache), rustdoc[14416492b31d7028]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  32:     0x55c117dc6dc7 - <rustc_middle[2a277d44e6a99f4f]::ty::context::GlobalCtxt>::enter::<rustdoc[14416492b31d7028]::main_args::{closure#1}::{closure#0}::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>
  33:     0x55c117d6c9f0 - <rustc_interface[3e6023fe39c52850]::interface::Compiler>::enter::<rustdoc[14416492b31d7028]::main_args::{closure#1}::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>
  34:     0x55c117e5ee9b - rustc_span[97beb3ced854c2e2]::with_source_map::<core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>, rustc_interface[3e6023fe39c52850]::interface::run_compiler<core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>, rustdoc[14416492b31d7028]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  35:     0x55c117d6fa22 - <scoped_tls[2916abd6437a3215]::ScopedKey<rustc_span[97beb3ced854c2e2]::SessionGlobals>>::set::<rustc_interface[3e6023fe39c52850]::interface::run_compiler<core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>, rustdoc[14416492b31d7028]::main_args::{closure#1}>::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>
  36:     0x55c117e72490 - std[d6315e0f51da5517]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3e6023fe39c52850]::util::run_in_thread_pool_with_globals<rustc_interface[3e6023fe39c52850]::interface::run_compiler<core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>, rustdoc[14416492b31d7028]::main_args::{closure#1}>::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>
  37:     0x55c117f8ff5f - <<std[d6315e0f51da5517]::thread::Builder>::spawn_unchecked_<rustc_interface[3e6023fe39c52850]::util::run_in_thread_pool_with_globals<rustc_interface[3e6023fe39c52850]::interface::run_compiler<core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>, rustdoc[14416492b31d7028]::main_args::{closure#1}>::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[69c2f5c35675f1ee]::result::Result<(), rustc_errors[abf5e0320c3520e7]::ErrorGuaranteed>>::{closure#1} as core[69c2f5c35675f1ee]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f52384bdc83 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::heeffe32503a99aa5
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/alloc/src/boxed.rs:1988:9
  39:     0x7f52384bdc83 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5085270dbf970bb4
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/alloc/src/boxed.rs:1988:9
  40:     0x7f52384bdc83 - std::sys::unix::thread::Thread::new::thread_start::h76c3abd575e0d195
                               at /rustc/4507fdaaa27ea2fb59a41df2ce7d1f290da53dae/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7f5233e3bbb5 - <unknown>
  42:     0x7f5233ebdd90 - <unknown>
  43:                0x0 - <unknown>

error: 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.69.0-nightly (4507fdaaa 2023-02-18) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

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

query stack during panic:
#0 [doc_link_resolutions] resolutions for documentation links for a module
end of query stack
error: could not document `notclap`

@rustbot label +T-rustdoc


searched nightlies: from nightly-2023-01-01 to nightly-2023-02-23
regressed nightly: nightly-2023-02-12
searched commit range: 2773383...585f3ee
regressed commit: 5b45024

bisected with cargo-bisect-rustc v0.6.5
cc #94857
@clubby789 clubby789 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 23, 2023
@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 23, 2023
@clubby789
Copy link
Contributor Author

DefId being looked up: id=DefId(0:4 ~ notclap[15db]::m)
doc_link_resolutions table:

{
    DefId(0:0 ~ notclap[6267]): {
        (
            "ValueEnum",
            TypeNS,
        ): Some(
            Def(
                Enum,
                DefId(0:4 ~ notclap[6267]::m::ValueEnum),
            ),
        ),
        (
            "ValueEnum",
            ValueNS,
        ): None,
        (
            "ValueEnum",
            MacroNS,
        ): None,
    },
}

@GuillaumeGomez
Copy link
Member

cc @petrochenkov

@GuillaumeGomez GuillaumeGomez added the A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name label Feb 23, 2023
@petrochenkov petrochenkov self-assigned this Feb 23, 2023
@petrochenkov
Copy link
Contributor

Duplicate of #108334, fixed in #109266.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 17, 2023
rustdoc: Correctly merge import's and its target's docs in one more case

Fixes rust-lang#108334.
Fixes rust-lang#108378.
Fixes rust-lang#108658.
@bors bors closed this as completed in 0e8085a Mar 20, 2023
koraa added a commit to rosenpass/rosenpass that referenced this issue May 22, 2023
koraa added a commit to rosenpass/rosenpass that referenced this issue May 23, 2023
koraa added a commit to rosenpass/rosenpass that referenced this issue May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants