Repository navigation
rustdoc::bare_urls includes trailing . in the detected URL #159480
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.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
Code
#![deny(rustdoc::bare_urls)]
/// Visit https://example.com/docs.
//~^ ERROR this URL is not a hyperlink
pub fn documentation() {}Current output
error: this URL is not a hyperlink
--> $DIR/bare-url-trailing-period.rs:11:11
|
LL | /// Visit https://example.com/docs.
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/bare-url-trailing-period.rs:3:9
|
LL | #![deny(rustdoc::bare_urls)]
| ^^^^^^^^^^^^^^^^^^
help: use an automatic link instead
|
LL | /// Visit <https://example.com/docs.>
| + +Desired output
error: this URL is not a hyperlink
--> $DIR/bare-url-trailing-period.rs:11:11
|
LL | /// Visit https://example.com/docs.
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/bare-url-trailing-period.rs:3:9
|
LL | #![deny(rustdoc::bare_urls)]
| ^^^^^^^^^^^^^^^^^^
help: use an automatic link instead
|
LL | /// Visit <https://example.com/docs>.
| + +Rationale and extra context
Periods are valid in URLs, but very uncommon as the last character in one. Modify the link parser to exclude trailing ..
Other cases
Rust Version
1.97Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.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.
Activity
Rollup merge of rust-lang#159505 - uselessgoddess:fix/issue-159480, r…
Rollup merge of rust-lang#159505 - uselessgoddess:fix/issue-159480, r…
Unrolled build for #159505
Rollup merge of #159505 - uselessgoddess:fix/issue-159480, r=lolbinar…