Closed
Description
Starting with an ambiguous lib.rs:
pub mod x {}
pub fn x() {}
/// [x]
pub struct S;
rustdoc correctly reports the ambiguity and suggests the possible resolutions:
warning: `x` is both a module and a function
--> src/lib.rs:4:6
|
4 | /// [x]
| ^ ambiguous link
|
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default
help: to link to the module, prefix with the item type
|
4 | /// [module@x]
| ^^^^^^^^
help: to link to the function, add parentheses
|
4 | /// [x()]
| ^^^
In this case I want to link to the module so let's update lib.rs:
pub mod x {}
pub fn x() {}
/// [module@x]
pub struct S;
cargo doc
accepts this without warnings but the generated html file contains:
<a href="../repro/fn.x.html" title="module@x">module@x</a>
I would expect [module@x] to link to the module x, not the function x.
Mentioning tracking issue: #43466