rust/tests/rustdoc-ui/lints/bare-urls-limit.rs
binarycat 3005a09fed rustdoc: improve diagnostics on raw doc fragments
1. rustdoc::bare_urls doesn't output
   invalid suggestions if source_span_for_markdown_range
   fails to find a span

2. source_span_for_markdown_range tries harder to
   return a span by applying an additional diagnostic

fixes https://github.com/rust-lang/rust/issues/135851
2025-05-22 12:31:28 -05:00

13 lines
391 B
Rust

//@ check-fail
#![deny(rustdoc::bare_urls)]
// examples of bare urls that are beyond our ability to generate suggestions for
// this falls through every heuristic in `source_span_for_markdown_range`,
// and thus does not get any suggestion.
#[doc = "good: <https://example.com/> \n\n"]
//~^ ERROR this URL is not a hyperlink
#[doc = "bad: https://example.com/"]
pub fn duplicate_raw() {}