-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
rustdoc's automatic link suggestion is syntactically invalid when the link is in a #[doc] attribute #135851
Copy link
Copy link
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Running
rustdocon that code produces the following output:The replacement suggestion is correct for the link in the doc comment, but syntactically incorrect for the one in the
#[doc]attribute - it should suggest#[doc = "<https://rust-lang.org>"]instead.The bug happens on both stable (
rustdoc 1.84.0 (9fc6b4312 2025-01-07)) and nightly (rustdoc 1.86.0-nightly (f3d1d47fd 2025-01-20)).