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

No resolutions for a doc link #120444

Closed
simonsan opened this issue Jan 28, 2024 · 2 comments · Fixed by #120702
Closed

No resolutions for a doc link #120444

simonsan opened this issue Jan 28, 2024 · 2 comments · Fixed by #120702
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-resolve Area: Name resolution C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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

@simonsan
Copy link

simonsan commented Jan 28, 2024

Code

Basically this is the module where it fails, right now I can't create a minimized example, I'll try to later:
https://github.com/rustic-rs/rustic_core/blob/057b8acf48caadb23ddc4b51dd032e69cd126cc8/crates/core/src/vfs/webdavfs.rs

Command

cargo +stable doc --no-deps --all-features -p rustic_core
cargo +nightly doc --no-deps --all-features -p rustic_core

on: https://github.com/rustic-rs/rustic_core/
branch: repository-more-access

Meta

Bug also exists on nightly, and also on Linux:

rustc --version --verbose:

rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-pc-windows-msvc
release: 1.75.0
LLVM version: 17.0.6

Error output

error: internal compiler error: compiler\rustc_metadata\src\rmeta\encoder.rs:2276:36: no resolutions for a doc link
 --> crates\core\src\vfs.rs:3:1
  |
3 | mod webdavfs;
  | ^^^^^^^^^^^^

rustc-ice-2024-01-28T11_00_48-4856.txt

Backtrace

error: internal compiler error: compiler\rustc_metadata\src\rmeta\encoder.rs:2276:36: no resolutions for a doc link
 --> crates\core\src\vfs.rs:3:1
  |
3 | mod webdavfs;
  | ^^^^^^^^^^^^

thread 'rustc' panicked at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1\compiler\rustc_errors\src\lib.rs:980:41:
Box<dyn Any>
stack backtrace:
   0:     0x7ffa209b2252 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he7d1ca341df54a85
   1:     0x7ffa209e4c4d - core::fmt::write::he1928d3c9fd3e726
   2:     0x7ffa209a8d41 - <std::io::IoSlice as core::fmt::Debug>::fmt::h75106291429179c2
   3:     0x7ffa209b207a - std::sys_common::backtrace::lock::hcadabe22c39262a1
   4:     0x7ffa209b54b9 - std::panicking::default_hook::h44204a891c2eb359
   5:     0x7ffa209b5175 - std::panicking::default_hook::h44204a891c2eb359
   6:     0x7ffa1755da43 - <tracing_subscriber[d07e7bfc55775049]::fmt::format::Writer>::write_fmt
   7:     0x7ffa209b5ad3 - std::panicking::rust_panic_with_hook::h1e10d5fa9efdead2
   8:     0x7ffa18a858c8 - <std[b97f18c21febf98c]::io::error::Error as rustc_errors[2694341c9eb5e463]::diagnostic::IntoDiagnosticArg>::into_diagnostic_arg
   9:     0x7ffa18a857c9 - <std[b97f18c21febf98c]::io::error::Error as rustc_errors[2694341c9eb5e463]::diagnostic::IntoDiagnosticArg>::into_diagnostic_arg
  10:     0x7ffa18a692e9 - <rustc_errors[2694341c9eb5e463]::json::JsonEmitter as rustc_errors[2694341c9eb5e463]::emitter::Emitter>::emit_unused_externs
  11:     0x7ffa18a6ab45 - <rustc_errors[2694341c9eb5e463]::diagnostic_builder::BugAbort as rustc_errors[2694341c9eb5e463]::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7ffa1868e702 - <std[b97f18c21febf98c]::ffi::os_str::OsString as cc[9add6413de8b60dc]::com::FromWide>::from_wide
  13:     0x7ffa186adb0b - <rustc_metadata[ed3cef24f4d8963f]::locator::MetadataError as core[a17afb67be504a5a]::fmt::Display>::fmt      
  14:     0x7ffa186adb3d - <rustc_metadata[ed3cef24f4d8963f]::locator::MetadataError as core[a17afb67be504a5a]::fmt::Display>::fmt      
  15:     0x7ffa186ad7dd - <rustc_metadata[ed3cef24f4d8963f]::locator::MetadataError as core[a17afb67be504a5a]::fmt::Display>::fmt      
  16:     0x7ffa186ad736 - <rustc_metadata[ed3cef24f4d8963f]::locator::MetadataError as core[a17afb67be504a5a]::fmt::Display>::fmt      
  17:     0x7ffa186a1327 - <rustc_metadata[ed3cef24f4d8963f]::rmeta::encoder::EncodeContext as rustc_serialize[814543858e663cd0]::serialize::Encoder>::emit_i32
  18:     0x7ffa180ad537 - <rustc_query_impl[a23969f5ac20a0c0]::plumbing::QueryCtxt as rustc_query_system[b5a5fd99fb29848c]::query::QueryContext>::depth_limit_error
  19:     0x7ffa180f7f43 - <rustc_query_impl[a23969f5ac20a0c0]::plumbing::QueryCtxt as rustc_query_system[b5a5fd99fb29848c]::query::QueryContext>::depth_limit_error
  20:     0x7ffa16ebbd1c - <rustc_query_impl[a23969f5ac20a0c0]::plumbing::QueryCtxt as rustc_query_system[b5a5fd99fb29848c]::query::QueryContext>::load_side_effects
  21:     0x7ffa181402b4 - <rustc_query_impl[a23969f5ac20a0c0]::plumbing::QueryCtxt as rustc_query_system[b5a5fd99fb29848c]::query::QueryContext>::depth_limit_error
  22:     0x7ff701672c1c - <unknown>
  23:     0x7ff70169f3d2 - <unknown>
  24:     0x7ff70175dda4 - <unknown>
  25:     0x7ff70175de8c - <unknown>
  26:     0x7ff70175de8c - <unknown>
  27:     0x7ff70175de8c - <unknown>
  28:     0x7ff70175d7db - <unknown>
  29:     0x7ff7013e6d29 - <unknown>
  30:     0x7ff701668a8c - <unknown>
  31:     0x7ff701760c76 - <unknown>
  32:     0x7ff701411f12 - <unknown>
  33:     0x7ff7013e1dae - <unknown>
  34:     0x7ff7015cc8d0 - <unknown>
  35:     0x7ff70147212a - <unknown>
  36:     0x7ffa209c7e2c - std::sys::windows::thread::Thread::new::habdaecfdf4916801
  37:     0x7ffae507257d - BaseThreadInitThunk
  38:     0x7ffae59aaa58 - RtlUserThreadStart

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

note: please attach the file at `C:\Users\dailyuse\backup\PARA\Personal\2 Areas\Developer\Maintenance\rustic\core\rustc-ice-2024-01-28T11_02_26-38248.txt` to your bug report

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
warning: `rustic_core` (lib doc) generated 3 warnings
error: could not document `rustic_core`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name rustic_core crates\core\src/lib.rs -o P:\.cargo-target\doc --cfg "feature=\"clap\"" --cfg "feature=\"cli\"" --cfg "feature=\"default\"" --cfg "feature=\"merge\"" --cfg "feature=\"webdav\"" --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=135 --document-private-items -C metadata=d157b0f91d739ede -L dependency=P:\.cargo-target\debug\deps --extern aes256ctr_poly1305aes=P:\.cargo-target\debug\deps\libaes256ctr_poly1305aes-e191f485915ede41.rmeta --extern anyhow=P:\.cargo-target\debug\deps\libanyhow-80ce99a79181a5e5.rmeta --extern binrw=P:\.cargo-target\debug\deps\libbinrw-f3d6c2da100c0bab.rmeta --extern bytes=P:\.cargo-target\debug\deps\libbytes-96907d59deb87275.rmeta --extern bytesize=P:\.cargo-target\debug\deps\libbytesize-dcc38144827ce3d8.rmeta --extern cached=P:\.cargo-target\debug\deps\libcached-b5177d4ac3bce87d.rmeta --extern cachedir=P:\.cargo-target\debug\deps\libcachedir-e98d7e2ea1e90d85.rmeta --extern chrono=P:\.cargo-target\debug\deps\libchrono-906ef8bc5d28b3e3.rmeta --extern clap=P:\.cargo-target\debug\deps\libclap-fc6c496bca4583b4.rmeta --extern crossbeam_channel=P:\.cargo-target\debug\deps\libcrossbeam_channel-95b4490e9972d91b.rmeta --extern dav_server=P:\.cargo-target\debug\deps\libdav_server-140b00244ed8c03c.rmeta --extern derivative=P:\.cargo-target\debug\deps\derivative-6bd6681c013cf4f9.dll --extern derive_more=P:\.cargo-target\debug\deps\derive_more-6da1c18b2cd51d35.dll --extern derive_setters=P:\.cargo-target\debug\deps\derive_setters-ff724feb82885df9.dll --extern dirs=P:\.cargo-target\debug\deps\libdirs-40e058ce1d82339d.rmeta --extern displaydoc=P:\.cargo-target\debug\deps\displaydoc-6303b26d58363a70.dll --extern dunce=P:\.cargo-target\debug\deps\libdunce-d4679e067f05bf34.rmeta --extern enum_map=P:\.cargo-target\debug\deps\libenum_map-6220444f5bee728d.rmeta --extern enum_map_derive=P:\.cargo-target\debug\deps\enum_map_derive-8c90a4aea85b9ac7.dll --extern filetime=P:\.cargo-target\debug\deps\libfiletime-2108d7f077c6ed04.rmeta --extern futures=P:\.cargo-target\debug\deps\libfutures-91f24aadd8df4b62.rmeta --extern gethostname=P:\.cargo-target\debug\deps\libgethostname-6f8766f37c499f72.rmeta --extern hex=P:\.cargo-target\debug\deps\libhex-584f4f4aaf753a21.rmeta --extern humantime=P:\.cargo-target\debug\deps\libhumantime-2af3f78124552961.rmeta --extern ignore=P:\.cargo-target\debug\deps\libignore-ccf20a0e0cd2ce0f.rmeta --extern integer_sqrt=P:\.cargo-target\debug\deps\libinteger_sqrt-c8d33067d403652f.rmeta --extern itertools=P:\.cargo-target\debug\deps\libitertools-3af50cd77ab326f2.rmeta --extern log=P:\.cargo-target\debug\deps\liblog-6c1aeb3bffeeeac8.rmeta --extern merge=P:\.cargo-target\debug\deps\libmerge-2b6e45850834b9df.rmeta --extern nix=P:\.cargo-target\debug\deps\libnix-ac10a178ad11adcf.rmeta --extern pariter=P:\.cargo-target\debug\deps\libpariter-be66a1d40314b3ed.rmeta --extern path_dedot=P:\.cargo-target\debug\deps\libpath_dedot-d49029d0a6d14b48.rmeta --extern quick_cache=P:\.cargo-target\debug\deps\libquick_cache-c547a52808024a10.rmeta --extern rand=P:\.cargo-target\debug\deps\librand-c6d75f14b395524a.rmeta --extern rayon=P:\.cargo-target\debug\deps\librayon-790b7c3c5bf416da.rmeta --extern runtime_format=P:\.cargo-target\debug\deps\libruntime_format-97eef50ccbda0bf2.rmeta --extern scrypt=P:\.cargo-target\debug\deps\libscrypt-dc594a008b01f8dd.rmeta --extern serde=P:\.cargo-target\debug\deps\libserde-8d8def4d8998d3c0.rmeta --extern serde_aux=P:\.cargo-target\debug\deps\libserde_aux-950315ddd74b2538.rmeta --extern serde_derive=P:\.cargo-target\debug\deps\serde_derive-4f32282b8a9a5a93.dll --extern serde_json=P:\.cargo-target\debug\deps\libserde_json-6715dee5de746c1d.rmeta --extern serde_with=P:\.cargo-target\debug\deps\libserde_with-5daedb0cdc5afbb3.rmeta --extern sha2=P:\.cargo-target\debug\deps\libsha2-1ca70e69fc96a3ba.rmeta --extern shell_words=P:\.cargo-target\debug\deps\libshell_words-1d70d0bdcce6895b.rmeta --extern thiserror=P:\.cargo-target\debug\deps\libthiserror-e1764d757ff447d9.rmeta --extern walkdir=P:\.cargo-target\debug\deps\libwalkdir-87cd7bb212e6af5b.rmeta --extern zstd=P:\.cargo-target\debug\deps\libzstd-929673bebe68b4a5.rmeta --document-private-items --crate-version 0.1.2` (exit code: 101)

@simonsan simonsan 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 Jan 28, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 28, 2024
@aawsome
Copy link

aawsome commented Jan 28, 2024

I can confirm this bug on

rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.73.0
LLVM version: 17.0.2

@lukas-code
Copy link
Member

minimized repro:

mod webdavfs {
    pub struct WebDavFS;
}

/// [`Vfs`]
pub use webdavfs::WebDavFS;

pub struct Vfs;
rustdoc --document-private-items filename.rs

@rustbot label T-rustdoc A-intra-doc-links A-resolve S-has-mcve -needs-triage

@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name A-resolve Area: Name resolution S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 28, 2024
@fmease fmease added the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Jan 29, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 7, 2024
docs: also check the inline stmt during redundant link check

Fixes rust-lang#120444

This issue was brought about by querying `root::webdavfs::A`, a key that doesn't exist in `doc_link_resolutions`. To avoid a panic, I've altered the gating mechanism to allow this lint pass to be skipped.

I'm not certain if this is the best solution. An alternative approach might be to leverage other info from the name resolutions instead of `doc_link_resolutions`. After all, all we need is to get the resolution from a combination of `(module, name)`. However, I believe they would yield the same outcome, both skipping this lint.
@bors bors closed this as completed in fec3235 Feb 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 8, 2024
Rollup merge of rust-lang#120702 - bvanjoi:fix-120444, r=notriddle

docs: also check the inline stmt during redundant link check

Fixes rust-lang#120444

This issue was brought about by querying `root::webdavfs::A`, a key that doesn't exist in `doc_link_resolutions`. To avoid a panic, I've altered the gating mechanism to allow this lint pass to be skipped.

I'm not certain if this is the best solution. An alternative approach might be to leverage other info from the name resolutions instead of `doc_link_resolutions`. After all, all we need is to get the resolution from a combination of `(module, name)`. However, I believe they would yield the same outcome, both skipping this lint.
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 A-resolve Area: Name resolution C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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.

5 participants