Closed
Description
I tried this code:
/// [type@std::io::not::here]
pub fn f() {}
I expected to the same diagnostic as without a disambiguator:
warning: unresolved link to `std::io::not::here`
--> tmp.rs:2:6
|
2 | /// [std::io::not::here]
| ^^^^^^^^^^^^^^^^^^ the module `io` has no inner item named `not`
Instead, rustdoc gave a diagnostic that made no sense:
warning: unresolved link to `std::io::not::here`
--> tmp.rs:1:6
|
1 | /// [type@std::io::not::here]
| ^^^^^^^^^^^^^^^^^^^^^^^ the module `io` has no type named `std::io`
Meta
rustc --version --verbose
:
rustdoc 1.48.0-nightly (bbc677480 2020-09-18)
Relevant code:
rust/src/librustdoc/passes/collect_intra_doc_links.rs
Lines 209 to 230 in 8a13fc4
The issue is that
variant_field
is only called for the value namespace, but it's in charge of giving diagnostics for intermediate paths. That logic should instead be moved to fn resolution_failure
.