-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Given the following code:
//! [nod@x]
//! [f@foo]
mod x {}
fn foo() {}
macro_rules! foo {
() => {}
}
The current output is:
warning: unknown disambiguator `nod`
--> unknown-disambiguator.rs:1:6
|
1 | //! [nod@x]
| ^^^
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
warning: unknown disambiguator `f`
--> unknown-disambiguator.rs:2:6
|
2 | //! [f@foo]
| ^
Ideally the output should look like:
warning: unknown disambiguator `nod`
--> unknown-disambiguator.rs:1:6
|
1 | //! [nod@x]
| ^^^
|
= note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
= help: remove the disambiguator: `[x]`
warning: unknown disambiguator `f`
--> unknown-disambiguator.rs:2:6
|
2 | //! [f@foo]
| ^
= help: link to the function: `[foo()]`
= help: link to the macro: `[foo!()]`
This will be tricky because right now resolving links is intermingled with emitting warnings, there's no way to say "will this link resolve".
lopopolo
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.