Skip to content

ICE: rustdoc: no resolution for "Clone" ValueNS #110495

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

Closed
fmease opened this issue Apr 18, 2023 · 1 comment · Fixed by #110501
Closed

ICE: rustdoc: no resolution for "Clone" ValueNS #110495

fmease opened this issue Apr 18, 2023 · 1 comment · Fixed by #110501
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@fmease
Copy link
Member

fmease commented Apr 18, 2023

//! [Clone ()].

The space before the parentheses is fundamental for reproducing the ICE.

Stderr:

thread 'rustc' panicked at 'no resolution for "Clone" ValueNS DefId(0:0 ~ ice[8695])', src/librustdoc/passes/collect_intra_doc_links.rs:400:32
Backtrace

stack backtrace:
   0:     0x7f8378d653c2 - std::backtrace_rs::backtrace::libunwind::trace::h525b1374168ca5f5
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8378d653c2 - std::backtrace_rs::backtrace::trace_unsynchronized::hbe1189bd30120710
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8378d653c2 - std::sys_common::backtrace::_print_fmt::h6d41ce120747d96c
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f8378d653c2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he5f24c3f95c04d12
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8378dc95df - core::fmt::write::hd579dd2cd8b90ab4
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/core/src/fmt/mod.rs:1254:17
   5:     0x7f8378d58371 - std::io::Write::write_fmt::h08f41109b1759352
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/io/mod.rs:1698:15
   6:     0x7f8378d651c5 - std::sys_common::backtrace::_print::h737d8d1dfcf76757
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f8378d651c5 - std::sys_common::backtrace::print::h39334e0c9054c05f
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f8378d67e87 - std::panicking::default_hook::{{closure}}::h25ffe0afd704bb41
   9:     0x7f8378d67c75 - std::panicking::default_hook::hcc330145d87d1abb
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/panicking.rs:288:9
  10:     0x7f837c044815 - <rustc_driver_impl[d341cd7f64842292]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[b8003d5837be85a8]::ops::function::FnOnce<(&core[b8003d5837be85a8]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f8378d685c5 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf364256ba514b763
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/alloc/src/boxed.rs:1987:9
  12:     0x7f8378d685c5 - std::panicking::rust_panic_with_hook::hf301d5f852bec833
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/panicking.rs:695:13
  13:     0x7f8378d68339 - std::panicking::begin_panic_handler::{{closure}}::h7282266f4cf8a4a9
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/panicking.rs:582:13
  14:     0x7f8378d65806 - std::sys_common::backtrace::__rust_end_short_backtrace::h8026ff750646ab77
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/sys_common/backtrace.rs:150:18
  15:     0x7f8378d68092 - rust_begin_unwind
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/panicking.rs:578:5
  16:     0x7f8378dc5953 - core::panicking::panic_fmt::haeb362b34c4a0862
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/core/src/panicking.rs:67:14
  17:     0x55990847e1c7 - <rustdoc[8246ea49ca4ce650]::passes::collect_intra_doc_links::LinkCollector>::resolve_path
  18:     0x55990847e338 - <rustdoc[8246ea49ca4ce650]::passes::collect_intra_doc_links::LinkCollector>::resolve
  19:     0x55990848383d - <rustdoc[8246ea49ca4ce650]::passes::collect_intra_doc_links::LinkCollector>::resolve_links
  20:     0x55990847cdfd - rustdoc[8246ea49ca4ce650]::passes::collect_intra_doc_links::collect_intra_doc_links
  21:     0x5599086236b2 - <rustc_session[e7b0bce5b7a65ece]::session::Session>::time::<rustdoc[8246ea49ca4ce650]::clean::types::Crate, rustdoc[8246ea49ca4ce650]::core::run_global_ctxt::{closure#8}>
  22:     0x5599086c2f4e - rustdoc[8246ea49ca4ce650]::core::run_global_ctxt
  23:     0x55990862392e - <rustc_session[e7b0bce5b7a65ece]::session::Session>::time::<(rustdoc[8246ea49ca4ce650]::clean::types::Crate, rustdoc[8246ea49ca4ce650]::config::RenderOptions, rustdoc[8246ea49ca4ce650]::formats::cache::Cache), rustdoc[8246ea49ca4ce650]::main_args::{closure#1}::{closure#0}::{closure#0}::{closure#0}>
  24:     0x55990858d1d8 - <std[d7940225b46693d5]::thread::local::LocalKey<core[b8003d5837be85a8]::cell::Cell<*const ()>>>::with::<rustc_middle[8d82ae2353292c40]::ty::context::tls::enter_context<<rustc_middle[8d82ae2353292c40]::ty::context::GlobalCtxt>::enter<rustdoc[8246ea49ca4ce650]::main_args::{closure#1}::{closure#0}::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>
  25:     0x55990864cb7b - <rustc_interface[6d2e349332c04921]::queries::QueryResult<&rustc_middle[8d82ae2353292c40]::ty::context::GlobalCtxt>>::enter::<core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>, rustdoc[8246ea49ca4ce650]::main_args::{closure#1}::{closure#0}::{closure#0}>
  26:     0x5599084c43be - <rustc_interface[6d2e349332c04921]::interface::Compiler>::enter::<rustdoc[8246ea49ca4ce650]::main_args::{closure#1}::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>
  27:     0x5599086cd6fb - rustc_span[e29a588bda90721d]::set_source_map::<core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>, rustc_interface[6d2e349332c04921]::interface::run_compiler<core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>, rustdoc[8246ea49ca4ce650]::main_args::{closure#1}>::{closure#0}::{closure#0}>
  28:     0x5599084c602d - <scoped_tls[400ad5b00280e7e0]::ScopedKey<rustc_span[e29a588bda90721d]::SessionGlobals>>::set::<rustc_interface[6d2e349332c04921]::interface::run_compiler<core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>, rustdoc[8246ea49ca4ce650]::main_args::{closure#1}>::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>
  29:     0x559908442319 - std[d7940225b46693d5]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6d2e349332c04921]::util::run_in_thread_pool_with_globals<rustc_interface[6d2e349332c04921]::interface::run_compiler<core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>, rustdoc[8246ea49ca4ce650]::main_args::{closure#1}>::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>
  30:     0x559908734a8d - <<std[d7940225b46693d5]::thread::Builder>::spawn_unchecked_<rustc_interface[6d2e349332c04921]::util::run_in_thread_pool_with_globals<rustc_interface[6d2e349332c04921]::interface::run_compiler<core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>, rustdoc[8246ea49ca4ce650]::main_args::{closure#1}>::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b8003d5837be85a8]::result::Result<(), rustc_span[e29a588bda90721d]::ErrorGuaranteed>>::{closure#1} as core[b8003d5837be85a8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x7f8378d72a85 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3bc15d1a646f1457
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/alloc/src/boxed.rs:1973:9
  32:     0x7f8378d72a85 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb9beb1ea11c0ec94
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/alloc/src/boxed.rs:1973:9
  33:     0x7f8378d72a85 - std::sys::unix::thread::Thread::new::thread_start::hd509204763cabd02
                               at /rustc/7908a1d65496b88626e4b7c193c81d777005d6f3/library/std/src/sys/unix/thread.rs:108:17
  34:     0x7f8378a25bb5 - <unknown>
  35:     0x7f8378aa7d90 - <unknown>
  36:                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.71.0-nightly (7908a1d65 2023-04-17) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

Meta

rustdoc -Vv:

rustdoc 1.71.0-nightly (7908a1d65 2023-04-17)
binary: rustdoc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

@rustbot label I-ICE T-rustdoc A-intra-doc-links
@rustbot claim

@fmease fmease added the C-bug Category: This is a bug. label Apr 18, 2023
@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 18, 2023
@fmease fmease changed the title ICE: rustdoc: no resolution for "fn:Clone" ValueNS ICE: rustdoc: no resolution for "Clone" ValueNS Apr 18, 2023
@fmease
Copy link
Member Author

fmease commented Apr 18, 2023

Without the space, rustdoc correctly reports:

warning: unresolved link to `Clone`
 --> ice.rs:1:6
  |
1 | //! [Clone()].
  |      ^^^^^^^ this link resolves to the trait `Clone`, which is not in the value namespace
  |
  = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
help: to link to the trait, prefix with `trait@`
  |
1 - //! [Clone()].
1 + //! [trait@Clone].
  |

warning: 1 warning emitted

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-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.

2 participants