rustdoc's automatic link suggestion is syntactically invalid when the link is in a #[doc]
attribute
#135851
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-invalid-suggestion
Diagnostics: A structured suggestion resulting in incorrect code.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Running
rustdoc
on 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)
).The text was updated successfully, but these errors were encountered: