Repository navigation
rustdoc::bare_urls URL detection cuts off on underscore #162345
Copy link
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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.
Description
I tried
/// See https://en.wikipedia.org/wiki/Rust_(programming_language)
fn main() {
println!("Hello, world!");
}and then ran cargo doc:
root@7db9afd9db3d:/rust/tests/rustdoc-demo# cargo doc
warning: this URL is not a hyperlink
--> src/main.rs:1:9
|
1 | /// See https://en.wikipedia.org/wiki/Rust_(programming_language)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
= note: `#[warn(rustdoc::bare_urls)]` on by default
help: use an automatic link instead
|
1 | /// See <https://en.wikipedia.org/wiki/Rust>_(programming_language)
| + +
warning: `rustdoc-demo` (bin "rustdoc-demo" doc) generated 1 warning (run `cargo fix --bin "rustdoc-demo" -p rustdoc-demo` to apply 1 suggestion)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s
Generated /rust/tests/rustdoc-demo/target/doc/rustdoc_demo/index.html
expected output:
root@7db9afd9db3d:/rust/tests/rustdoc-demo# cargo doc
warning: this URL is not a hyperlink
--> src/main.rs:1:9
|
1 | /// See https://en.wikipedia.org/wiki/Rust_(programming_language)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
= note: `#[warn(rustdoc::bare_urls)]` on by default
help: use an automatic link instead
|
1 | /// See <https://en.wikipedia.org/wiki/Rust_(programming_language)>
| + +
warning: `rustdoc-demo` (bin "rustdoc-demo" doc) generated 1 warning (run `cargo fix --bin "rustdoc-demo" -p rustdoc-demo` to apply 1 suggestion)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s
Generated /rust/tests/rustdoc-demo/target/doc/rustdoc_demo/index.html
versions:
- cargo 1.98.1 (797e8a9bc 2026-08-05)
- rustc 1.98.1 (48a229c 2026-09-01)
- rustdoc 1.98.1 (48a229c 2026-09-01)
@rustbot label T-rustdoc A-diagnostics A-suggestion-diagnostics D-invalid-suggestion
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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.
Activity
Rollup merge of rust-lang#162381 - malezjaa:fix-bare-urls-split-text,…
Rollup merge of rust-lang#162381 - malezjaa:fix-bare-urls-split-text,…
Rollup merge of rust-lang#162381 - malezjaa:fix-bare-urls-split-text,…
Rollup merge of rust-lang#162381 - malezjaa:fix-bare-urls-split-text,…
Rollup merge of rust-lang#162381 - malezjaa:fix-bare-urls-split-text,…
Rollup merge of rust-lang#162381 - malezjaa:fix-bare-urls-split-text,…
Unrolled build for #162381 in rollup 162406
notriddle commentedon Sep 16, 2026
Reverted by #162779
Rollup merge of rust-lang#162835 - notriddle:notriddle/parens-bare-ur…
Rollup merge of #162381 - malezjaa:fix-bare-urls-split-text, r=notriddle
Rollup merge of rust-lang#162835 - notriddle:notriddle/parens-bare-ur…
Rollup merge of rust-lang#162835 - notriddle:notriddle/parens-bare-ur…
Unrolled build for #162835 in rollup 163095
Rollup merge of #162835 - notriddle:notriddle/parens-bare-url, r=lolb…