forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#84079 - camelid:improve-bare-urls-test, r=j…
…yn514 Improve test for `rustdoc::bare_urls` lint - Rename `url-improvements` test to `bare-urls` - Run rustfix for `bare-urls` test
- Loading branch information
Showing
3 changed files
with
80 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// run-rustfix | ||
|
||
#![deny(rustdoc::bare_urls)] | ||
|
||
/// <https://somewhere.com> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com/a> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://www.somewhere.com> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://www.somewhere.com/a> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://subdomain.example.com> | ||
//~^ ERROR not a hyperlink | ||
/// <https://somewhere.com?> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com/a?> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com?hello=12> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com/a?hello=12> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://example.com?hello=12#xyz> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://example.com/a?hello=12#xyz> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://example.com#xyz> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://example.com/a#xyz> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com?hello=12&bye=11> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com/a?hello=12&bye=11> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// <https://somewhere.com?hello=12&bye=11#xyz> | ||
//~^ ERROR this URL is not a hyperlink | ||
/// hey! <https://somewhere.com/a?hello=12&bye=11#xyz> | ||
//~^ ERROR this URL is not a hyperlink | ||
pub fn c() {} | ||
|
||
/// <https://somewhere.com> | ||
/// [a](http://a.com) | ||
/// [b] | ||
/// | ||
/// [b]: http://b.com | ||
/// | ||
/// ``` | ||
/// This link should not be linted: http://example.com | ||
/// | ||
/// Nor this one: <http://example.com> or this one: [x](http://example.com) | ||
/// ``` | ||
/// | ||
/// [should_not.lint](should_not.lint) | ||
pub fn everything_is_fine_here() {} | ||
|
||
#[allow(rustdoc::bare_urls)] | ||
pub mod foo { | ||
/// https://somewhere.com/a?hello=12&bye=11#xyz | ||
pub fn bar() {} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/test/rustdoc-ui/url-improvements.rs → src/test/rustdoc-ui/bare-urls.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// run-rustfix | ||
|
||
#![deny(rustdoc::bare_urls)] | ||
|
||
/// https://somewhere.com | ||
|
36 changes: 18 additions & 18 deletions
36
src/test/rustdoc-ui/url-improvements.stderr → src/test/rustdoc-ui/bare-urls.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters