diff options
Diffstat (limited to 'src/test/rustdoc-ui')
| -rw-r--r-- | src/test/rustdoc-ui/renamed-lint-still-applies.rs | 5 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/renamed-lint-still-applies.stderr | 22 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/unknown-renamed-lints.rs | 6 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/unknown-renamed-lints.stderr | 18 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/url-improvements.rs | 16 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/url-improvements.stderr | 56 |
6 files changed, 72 insertions, 51 deletions
diff --git a/src/test/rustdoc-ui/renamed-lint-still-applies.rs b/src/test/rustdoc-ui/renamed-lint-still-applies.rs index 8c61c1ccb6a..05a32d3cc31 100644 --- a/src/test/rustdoc-ui/renamed-lint-still-applies.rs +++ b/src/test/rustdoc-ui/renamed-lint-still-applies.rs @@ -4,3 +4,8 @@ // stable channel. //! [x] //~^ ERROR unresolved link + +#![deny(rustdoc::non_autolinks)] +//~^ WARNING renamed to `rustdoc::bare_urls` +//! http://example.com +//~^ ERROR not a hyperlink diff --git a/src/test/rustdoc-ui/renamed-lint-still-applies.stderr b/src/test/rustdoc-ui/renamed-lint-still-applies.stderr index 8a12991558a..19c253b366b 100644 --- a/src/test/rustdoc-ui/renamed-lint-still-applies.stderr +++ b/src/test/rustdoc-ui/renamed-lint-still-applies.stderr @@ -1,3 +1,11 @@ +warning: lint `rustdoc::non_autolinks` has been renamed to `rustdoc::bare_urls` + --> $DIR/renamed-lint-still-applies.rs:8:9 + | +LL | #![deny(rustdoc::non_autolinks)] + | ^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `rustdoc::bare_urls` + | + = note: `#[warn(renamed_and_removed_lints)]` on by default + error: unresolved link to `x` --> $DIR/renamed-lint-still-applies.rs:5:6 | @@ -12,5 +20,17 @@ LL | #![deny(broken_intra_doc_links)] = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(broken_intra_doc_links)]` = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` -error: aborting due to previous error +error: this URL is not a hyperlink + --> $DIR/renamed-lint-still-applies.rs:10:5 + | +LL | //! http://example.com + | ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.com>` + | +note: the lint level is defined here + --> $DIR/renamed-lint-still-applies.rs:8:9 + | +LL | #![deny(rustdoc::non_autolinks)] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors; 1 warning emitted diff --git a/src/test/rustdoc-ui/unknown-renamed-lints.rs b/src/test/rustdoc-ui/unknown-renamed-lints.rs index a05c0c81168..9096cce1276 100644 --- a/src/test/rustdoc-ui/unknown-renamed-lints.rs +++ b/src/test/rustdoc-ui/unknown-renamed-lints.rs @@ -8,8 +8,12 @@ //~^ ERROR unknown lint: `rustdoc::x` #![deny(intra_doc_link_resolution_failure)] //~^ ERROR renamed to `rustdoc::broken_intra_doc_links` - #![deny(non_autolinks)] +//~^ ERROR renamed to `rustdoc::bare_urls` +#![deny(rustdoc::non_autolinks)] +//~^ ERROR renamed to `rustdoc::bare_urls` + +#![deny(private_doc_tests)] // FIXME: the old names for rustdoc lints should warn by default once `rustdoc::` makes it to the // stable channel. diff --git a/src/test/rustdoc-ui/unknown-renamed-lints.stderr b/src/test/rustdoc-ui/unknown-renamed-lints.stderr index 98bfb83c704..51e06821cf7 100644 --- a/src/test/rustdoc-ui/unknown-renamed-lints.stderr +++ b/src/test/rustdoc-ui/unknown-renamed-lints.stderr @@ -28,19 +28,31 @@ note: the lint level is defined here LL | #![deny(renamed_and_removed_lints)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ +error: lint `non_autolinks` has been renamed to `rustdoc::bare_urls` + --> $DIR/unknown-renamed-lints.rs:11:9 + | +LL | #![deny(non_autolinks)] + | ^^^^^^^^^^^^^ help: use the new name: `rustdoc::bare_urls` + +error: lint `rustdoc::non_autolinks` has been renamed to `rustdoc::bare_urls` + --> $DIR/unknown-renamed-lints.rs:13:9 + | +LL | #![deny(rustdoc::non_autolinks)] + | ^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `rustdoc::bare_urls` + error: lint `rustdoc` has been removed: use `rustdoc::all` instead - --> $DIR/unknown-renamed-lints.rs:16:9 + --> $DIR/unknown-renamed-lints.rs:20:9 | LL | #![deny(rustdoc)] | ^^^^^^^ error: unknown lint: `rustdoc::intra_doc_link_resolution_failure` - --> $DIR/unknown-renamed-lints.rs:20:9 + --> $DIR/unknown-renamed-lints.rs:24:9 | LL | #![deny(rustdoc::intra_doc_link_resolution_failure)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Compilation failed, aborting rustdoc -error: aborting due to 6 previous errors +error: aborting due to 8 previous errors diff --git a/src/test/rustdoc-ui/url-improvements.rs b/src/test/rustdoc-ui/url-improvements.rs index d0b43de2f0e..43a13b02d0a 100644 --- a/src/test/rustdoc-ui/url-improvements.rs +++ b/src/test/rustdoc-ui/url-improvements.rs @@ -1,14 +1,4 @@ -#![deny(rustdoc::non_autolinks)] - -/// [http://aa.com](http://aa.com) -//~^ ERROR unneeded long form for URL -/// [http://bb.com] -//~^ ERROR unneeded long form for URL -/// -/// [http://bb.com]: http://bb.com -/// -/// [http://c.com][http://c.com] -pub fn a() {} +#![deny(rustdoc::bare_urls)] /// https://somewhere.com //~^ ERROR this URL is not a hyperlink @@ -54,12 +44,14 @@ pub fn c() {} /// /// ``` /// 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::non_autolinks)] +#[allow(rustdoc::bare_urls)] pub mod foo { /// https://somewhere.com/a?hello=12&bye=11#xyz pub fn bar() {} diff --git a/src/test/rustdoc-ui/url-improvements.stderr b/src/test/rustdoc-ui/url-improvements.stderr index f377973656a..3d5ebd8be6b 100644 --- a/src/test/rustdoc-ui/url-improvements.stderr +++ b/src/test/rustdoc-ui/url-improvements.stderr @@ -1,122 +1,110 @@ -error: unneeded long form for URL +error: this URL is not a hyperlink --> $DIR/url-improvements.rs:3:5 | -LL | /// [http://aa.com](http://aa.com) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://aa.com>` +LL | /// https://somewhere.com + | ^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com>` | note: the lint level is defined here --> $DIR/url-improvements.rs:1:9 | -LL | #![deny(rustdoc::non_autolinks)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unneeded long form for URL - --> $DIR/url-improvements.rs:5:5 - | -LL | /// [http://bb.com] - | ^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://bb.com>` +LL | #![deny(rustdoc::bare_urls)] + | ^^^^^^^^^^^^^^^^^^ error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:13:5 - | -LL | /// https://somewhere.com - | ^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com>` - -error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:15:5 + --> $DIR/url-improvements.rs:5:5 | LL | /// https://somewhere.com/a | ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:17:5 + --> $DIR/url-improvements.rs:7:5 | LL | /// https://www.somewhere.com | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:19:5 + --> $DIR/url-improvements.rs:9:5 | LL | /// https://www.somewhere.com/a | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com/a>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:21:5 + --> $DIR/url-improvements.rs:11:5 | LL | /// https://subdomain.example.com | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://subdomain.example.com>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:23:5 + --> $DIR/url-improvements.rs:13:5 | LL | /// https://somewhere.com? | ^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:25:5 + --> $DIR/url-improvements.rs:15:5 | LL | /// https://somewhere.com/a? | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:27:5 + --> $DIR/url-improvements.rs:17:5 | LL | /// https://somewhere.com?hello=12 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:29:5 + --> $DIR/url-improvements.rs:19:5 | LL | /// https://somewhere.com/a?hello=12 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:31:5 + --> $DIR/url-improvements.rs:21:5 | LL | /// https://example.com?hello=12#xyz | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com?hello=12#xyz>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:33:5 + --> $DIR/url-improvements.rs:23:5 | LL | /// https://example.com/a?hello=12#xyz | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a?hello=12#xyz>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:35:5 + --> $DIR/url-improvements.rs:25:5 | LL | /// https://example.com#xyz | ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com#xyz>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:37:5 + --> $DIR/url-improvements.rs:27:5 | LL | /// https://example.com/a#xyz | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a#xyz>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:39:5 + --> $DIR/url-improvements.rs:29:5 | LL | /// https://somewhere.com?hello=12&bye=11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:41:5 + --> $DIR/url-improvements.rs:31:5 | LL | /// https://somewhere.com/a?hello=12&bye=11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:43:5 + --> $DIR/url-improvements.rs:33:5 | LL | /// https://somewhere.com?hello=12&bye=11#xyz | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11#xyz>` error: this URL is not a hyperlink - --> $DIR/url-improvements.rs:45:10 + --> $DIR/url-improvements.rs:35:10 | LL | /// hey! https://somewhere.com/a?hello=12&bye=11#xyz | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11#xyz>` -error: aborting due to 19 previous errors +error: aborting due to 17 previous errors |
