diff options
Diffstat (limited to 'src/test/rustdoc-ui')
61 files changed, 278 insertions, 264 deletions
diff --git a/src/test/rustdoc-ui/.gitattributes b/src/test/rustdoc-ui/.gitattributes deleted file mode 100644 index 2bcabdffb3d..00000000000 --- a/src/test/rustdoc-ui/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -intra-links-warning-crlf.rs eol=crlf diff --git a/src/test/rustdoc-ui/cfg-test.rs b/src/test/rustdoc-ui/cfg-test.rs index 597c86a1f19..d4ca9258587 100644 --- a/src/test/rustdoc-ui/cfg-test.rs +++ b/src/test/rustdoc-ui/cfg-test.rs @@ -1,6 +1,7 @@ // check-pass // compile-flags:--test --test-args --test-threads=1 // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // Crates like core have doctests gated on `cfg(not(test))` so we need to make // sure `cfg(test)` is not active when running `rustdoc --test`. diff --git a/src/test/rustdoc-ui/cfg-test.stdout b/src/test/rustdoc-ui/cfg-test.stdout index 474f13cfa98..2960ff8d3b4 100644 --- a/src/test/rustdoc-ui/cfg-test.stdout +++ b/src/test/rustdoc-ui/cfg-test.stdout @@ -1,7 +1,7 @@ running 2 tests -test $DIR/cfg-test.rs - Bar (line 26) ... ok -test $DIR/cfg-test.rs - Foo (line 18) ... ok +test $DIR/cfg-test.rs - Bar (line 27) ... ok +test $DIR/cfg-test.rs - Foo (line 19) ... ok -test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/check-doc-alias-attr-location.rs b/src/test/rustdoc-ui/check-doc-alias-attr-location.rs index 545964c7bd6..7de2caa189d 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr-location.rs +++ b/src/test/rustdoc-ui/check-doc-alias-attr-location.rs @@ -1,5 +1,3 @@ -#![feature(doc_alias)] - pub struct Bar; pub trait Foo { type X; diff --git a/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr b/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr index a66e9939eaf..175626f49dc 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr +++ b/src/test/rustdoc-ui/check-doc-alias-attr-location.stderr @@ -1,23 +1,23 @@ error: `#[doc(alias = "...")]` isn't allowed on extern block - --> $DIR/check-doc-alias-attr-location.rs:9:7 + --> $DIR/check-doc-alias-attr-location.rs:7:7 | LL | #[doc(alias = "foo")] | ^^^^^^^^^^^^^ error: `#[doc(alias = "...")]` isn't allowed on implementation block - --> $DIR/check-doc-alias-attr-location.rs:12:7 + --> $DIR/check-doc-alias-attr-location.rs:10:7 | LL | #[doc(alias = "bar")] | ^^^^^^^^^^^^^ error: `#[doc(alias = "...")]` isn't allowed on implementation block - --> $DIR/check-doc-alias-attr-location.rs:18:7 + --> $DIR/check-doc-alias-attr-location.rs:16:7 | LL | #[doc(alias = "foobar")] | ^^^^^^^^^^^^^^^^ error: `#[doc(alias = "...")]` isn't allowed on type alias in implementation block - --> $DIR/check-doc-alias-attr-location.rs:20:11 + --> $DIR/check-doc-alias-attr-location.rs:18:11 | LL | #[doc(alias = "assoc")] | ^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.rs b/src/test/rustdoc-ui/check-doc-alias-attr.rs index 0ca2349a43b..912e35f9165 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr.rs +++ b/src/test/rustdoc-ui/check-doc-alias-attr.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(doc_alias)] #[doc(alias = "foo")] // ok! pub struct Bar; diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.stderr b/src/test/rustdoc-ui/check-doc-alias-attr.stderr index 2c417a3bb65..1c7fc83bb8d 100644 --- a/src/test/rustdoc-ui/check-doc-alias-attr.stderr +++ b/src/test/rustdoc-ui/check-doc-alias-attr.stderr @@ -1,58 +1,58 @@ -error: doc alias attribute expects a string: #[doc(alias = "0")] - --> $DIR/check-doc-alias-attr.rs:7:7 +error: doc alias attribute expects a string: #[doc(alias = "a")] + --> $DIR/check-doc-alias-attr.rs:6:7 | LL | #[doc(alias)] | ^^^^^ -error: doc alias attribute expects a string: #[doc(alias = "0")] - --> $DIR/check-doc-alias-attr.rs:8:7 +error: doc alias attribute expects a string: #[doc(alias = "a")] + --> $DIR/check-doc-alias-attr.rs:7:7 | LL | #[doc(alias = 0)] | ^^^^^^^^^ -error: doc alias attribute expects a string: #[doc(alias = "0")] - --> $DIR/check-doc-alias-attr.rs:9:7 +error: doc alias attribute expects a string: #[doc(alias = "a")] + --> $DIR/check-doc-alias-attr.rs:8:7 | LL | #[doc(alias("bar"))] | ^^^^^^^^^^^^ error: '\"' character isn't allowed in `#[doc(alias = "...")]` - --> $DIR/check-doc-alias-attr.rs:10:7 + --> $DIR/check-doc-alias-attr.rs:9:15 | LL | #[doc(alias = "\"")] - | ^^^^^^^^^^^^ + | ^^^^ error: '\n' character isn't allowed in `#[doc(alias = "...")]` - --> $DIR/check-doc-alias-attr.rs:11:7 + --> $DIR/check-doc-alias-attr.rs:10:15 | LL | #[doc(alias = "\n")] - | ^^^^^^^^^^^^ + | ^^^^ error: '\n' character isn't allowed in `#[doc(alias = "...")]` - --> $DIR/check-doc-alias-attr.rs:12:7 + --> $DIR/check-doc-alias-attr.rs:11:15 | LL | #[doc(alias = " - | _______^ + | _______________^ LL | | ")] | |_^ error: '\t' character isn't allowed in `#[doc(alias = "...")]` - --> $DIR/check-doc-alias-attr.rs:14:7 + --> $DIR/check-doc-alias-attr.rs:13:15 | LL | #[doc(alias = "\t")] - | ^^^^^^^^^^^^ + | ^^^^ error: `#[doc(alias = "...")]` cannot start or end with ' ' - --> $DIR/check-doc-alias-attr.rs:15:7 + --> $DIR/check-doc-alias-attr.rs:14:15 | LL | #[doc(alias = " hello")] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ error: `#[doc(alias = "...")]` cannot start or end with ' ' - --> $DIR/check-doc-alias-attr.rs:16:7 + --> $DIR/check-doc-alias-attr.rs:15:15 | LL | #[doc(alias = "hello ")] - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^ error: aborting due to 9 previous errors diff --git a/src/test/rustdoc-ui/coverage/exotic.stdout b/src/test/rustdoc-ui/coverage/exotic.stdout index e282ff12843..27798b81310 100644 --- a/src/test/rustdoc-ui/coverage/exotic.stdout +++ b/src/test/rustdoc-ui/coverage/exotic.stdout @@ -1,8 +1,7 @@ +-------------------------------------+------------+------------+------------+------------+ | File | Documented | Percentage | Examples | Percentage | +-------------------------------------+------------+------------+------------+------------+ -| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 100.0% | 0 | 0.0% | -| <anon> | 2 | 100.0% | 0 | 0.0% | +| ...st/rustdoc-ui/coverage/exotic.rs | 3 | 100.0% | 0 | 0.0% | +-------------------------------------+------------+------------+------------+------------+ | Total | 3 | 100.0% | 0 | 0.0% | +-------------------------------------+------------+------------+------------+------------+ diff --git a/src/test/rustdoc-ui/doc-alias-assoc-const.rs b/src/test/rustdoc-ui/doc-alias-assoc-const.rs index 73e23c152f2..d95324734be 100644 --- a/src/test/rustdoc-ui/doc-alias-assoc-const.rs +++ b/src/test/rustdoc-ui/doc-alias-assoc-const.rs @@ -1,4 +1,3 @@ -#![feature(doc_alias)] #![feature(trait_alias)] pub struct Foo; diff --git a/src/test/rustdoc-ui/doc-alias-assoc-const.stderr b/src/test/rustdoc-ui/doc-alias-assoc-const.stderr index 3c64548cc20..cbca40e1364 100644 --- a/src/test/rustdoc-ui/doc-alias-assoc-const.stderr +++ b/src/test/rustdoc-ui/doc-alias-assoc-const.stderr @@ -1,5 +1,5 @@ error: `#[doc(alias = "...")]` isn't allowed on associated constant in trait implementation block - --> $DIR/doc-alias-assoc-const.rs:11:11 + --> $DIR/doc-alias-assoc-const.rs:10:11 | LL | #[doc(alias = "CONST_BAZ")] | ^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/doc-alias-crate-level.stderr b/src/test/rustdoc-ui/doc-alias-crate-level.stderr index fc14266cd71..a58e91c5aa7 100644 --- a/src/test/rustdoc-ui/doc-alias-crate-level.stderr +++ b/src/test/rustdoc-ui/doc-alias-crate-level.stderr @@ -1,8 +1,8 @@ error: '\'' character isn't allowed in `#[doc(alias = "...")]` - --> $DIR/doc-alias-crate-level.rs:5:7 + --> $DIR/doc-alias-crate-level.rs:5:15 | LL | #[doc(alias = "shouldn't work!")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ error: `#![doc(alias = "...")]` isn't allowed as a crate level attribute --> $DIR/doc-alias-crate-level.rs:3:8 diff --git a/src/test/rustdoc-ui/doc-test-doctest-feature.rs b/src/test/rustdoc-ui/doc-test-doctest-feature.rs index 9a79fb88383..0b79aaece8a 100644 --- a/src/test/rustdoc-ui/doc-test-doctest-feature.rs +++ b/src/test/rustdoc-ui/doc-test-doctest-feature.rs @@ -1,14 +1,12 @@ // check-pass // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" - -#![feature(cfg_doctest)] +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // Make sure `cfg(doctest)` is set when finding doctests but not inside // the doctests. /// ``` -/// #![feature(cfg_doctest)] /// assert!(!cfg!(doctest)); /// ``` #[cfg(doctest)] diff --git a/src/test/rustdoc-ui/doc-test-doctest-feature.stdout b/src/test/rustdoc-ui/doc-test-doctest-feature.stdout index 75d29fab17d..d7de1f10522 100644 --- a/src/test/rustdoc-ui/doc-test-doctest-feature.stdout +++ b/src/test/rustdoc-ui/doc-test-doctest-feature.stdout @@ -1,6 +1,6 @@ running 1 test -test $DIR/doc-test-doctest-feature.rs - Foo (line 10) ... ok +test $DIR/doc-test-doctest-feature.rs - Foo (line 9) ... ok -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs b/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs index 2af5782453e..bf334c67eca 100644 --- a/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs +++ b/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs @@ -1,6 +1,7 @@ // check-pass // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" #![feature(doc_cfg)] diff --git a/src/test/rustdoc-ui/doc-test-rustdoc-feature.stdout b/src/test/rustdoc-ui/doc-test-rustdoc-feature.stdout index f2525c2dbec..5b07fc4c87a 100644 --- a/src/test/rustdoc-ui/doc-test-rustdoc-feature.stdout +++ b/src/test/rustdoc-ui/doc-test-rustdoc-feature.stdout @@ -1,6 +1,6 @@ running 1 test -test $DIR/doc-test-rustdoc-feature.rs - Foo (line 9) ... ok +test $DIR/doc-test-rustdoc-feature.rs - Foo (line 10) ... ok -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/doc-without-codeblock.stderr b/src/test/rustdoc-ui/doc-without-codeblock.stderr index f2b2328322a..3372304f44a 100644 --- a/src/test/rustdoc-ui/doc-without-codeblock.stderr +++ b/src/test/rustdoc-ui/doc-without-codeblock.stderr @@ -17,12 +17,6 @@ LL | #![deny(missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing code example in this documentation - --> $DIR/doc-without-codeblock.rs:3:1 - | -LL | /// Some docs. - | ^^^^^^^^^^^^^^ - -error: missing code example in this documentation --> $DIR/doc-without-codeblock.rs:7:1 | LL | /// And then, the princess died. @@ -34,5 +28,11 @@ error: missing code example in this documentation LL | /// Or maybe not because she saved herself! | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error: missing code example in this documentation + --> $DIR/doc-without-codeblock.rs:3:1 + | +LL | /// Some docs. + | ^^^^^^^^^^^^^^ + error: aborting due to 4 previous errors diff --git a/src/test/rustdoc-ui/doctest-output.rs b/src/test/rustdoc-ui/doctest-output.rs index e0e1e061ac7..2670fa57201 100644 --- a/src/test/rustdoc-ui/doctest-output.rs +++ b/src/test/rustdoc-ui/doctest-output.rs @@ -2,6 +2,7 @@ // aux-build:extern_macros.rs // compile-flags:--test --test-args=--test-threads=1 // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // check-pass //! ``` diff --git a/src/test/rustdoc-ui/doctest-output.stdout b/src/test/rustdoc-ui/doctest-output.stdout index c72bd91d1dd..35b0e366fb5 100644 --- a/src/test/rustdoc-ui/doctest-output.stdout +++ b/src/test/rustdoc-ui/doctest-output.stdout @@ -1,8 +1,8 @@ running 3 tests -test $DIR/doctest-output.rs - (line 7) ... ok -test $DIR/doctest-output.rs - ExpandedStruct (line 23) ... ok -test $DIR/doctest-output.rs - foo::bar (line 17) ... ok +test $DIR/doctest-output.rs - (line 8) ... ok +test $DIR/doctest-output.rs - ExpandedStruct (line 24) ... ok +test $DIR/doctest-output.rs - foo::bar (line 18) ... ok -test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/failed-doctest-compile-fail.rs b/src/test/rustdoc-ui/failed-doctest-compile-fail.rs index 297d6efd45f..6f2ff5d703a 100644 --- a/src/test/rustdoc-ui/failed-doctest-compile-fail.rs +++ b/src/test/rustdoc-ui/failed-doctest-compile-fail.rs @@ -3,6 +3,7 @@ // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // failure-status: 101 /// ```compile_fail diff --git a/src/test/rustdoc-ui/failed-doctest-compile-fail.stdout b/src/test/rustdoc-ui/failed-doctest-compile-fail.stdout index 74e33d7beeb..b8bb5ccb403 100644 --- a/src/test/rustdoc-ui/failed-doctest-compile-fail.stdout +++ b/src/test/rustdoc-ui/failed-doctest-compile-fail.stdout @@ -1,14 +1,14 @@ running 1 test -test $DIR/failed-doctest-compile-fail.rs - Foo (line 8) ... FAILED +test $DIR/failed-doctest-compile-fail.rs - Foo (line 9) ... FAILED failures: ----- $DIR/failed-doctest-compile-fail.rs - Foo (line 8) stdout ---- +---- $DIR/failed-doctest-compile-fail.rs - Foo (line 9) stdout ---- Test compiled successfully, but it's marked `compile_fail`. failures: - $DIR/failed-doctest-compile-fail.rs - Foo (line 8) + $DIR/failed-doctest-compile-fail.rs - Foo (line 9) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/failed-doctest-missing-codes.rs b/src/test/rustdoc-ui/failed-doctest-missing-codes.rs index 62102062d49..57b70b478e6 100644 --- a/src/test/rustdoc-ui/failed-doctest-missing-codes.rs +++ b/src/test/rustdoc-ui/failed-doctest-missing-codes.rs @@ -3,6 +3,7 @@ // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // failure-status: 101 /// ```compile_fail,E0004 diff --git a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout index e4ed4622322..7367a7d6519 100644 --- a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout +++ b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout @@ -1,12 +1,12 @@ running 1 test -test $DIR/failed-doctest-missing-codes.rs - Foo (line 8) ... FAILED +test $DIR/failed-doctest-missing-codes.rs - Foo (line 9) ... FAILED failures: ----- $DIR/failed-doctest-missing-codes.rs - Foo (line 8) stdout ---- +---- $DIR/failed-doctest-missing-codes.rs - Foo (line 9) stdout ---- error[E0308]: mismatched types - --> $DIR/failed-doctest-missing-codes.rs:9:13 + --> $DIR/failed-doctest-missing-codes.rs:10:13 | LL | let x: () = 5i32; | -- ^^^^ expected `()`, found `i32` @@ -19,7 +19,7 @@ For more information about this error, try `rustc --explain E0308`. Some expected error codes were not found: ["E0004"] failures: - $DIR/failed-doctest-missing-codes.rs - Foo (line 8) + $DIR/failed-doctest-missing-codes.rs - Foo (line 9) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/failed-doctest-output.rs b/src/test/rustdoc-ui/failed-doctest-output.rs index 90cdb5127be..92473b49e14 100644 --- a/src/test/rustdoc-ui/failed-doctest-output.rs +++ b/src/test/rustdoc-ui/failed-doctest-output.rs @@ -5,6 +5,7 @@ // compile-flags:--test --test-args --test-threads=1 // rustc-env:RUST_BACKTRACE=0 // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // failure-status: 101 // doctest fails at runtime diff --git a/src/test/rustdoc-ui/failed-doctest-output.stdout b/src/test/rustdoc-ui/failed-doctest-output.stdout index ee79ae1a690..6dfe648f854 100644 --- a/src/test/rustdoc-ui/failed-doctest-output.stdout +++ b/src/test/rustdoc-ui/failed-doctest-output.stdout @@ -1,13 +1,13 @@ running 2 tests -test $DIR/failed-doctest-output.rs - OtherStruct (line 21) ... FAILED -test $DIR/failed-doctest-output.rs - SomeStruct (line 11) ... FAILED +test $DIR/failed-doctest-output.rs - OtherStruct (line 22) ... FAILED +test $DIR/failed-doctest-output.rs - SomeStruct (line 12) ... FAILED failures: ----- $DIR/failed-doctest-output.rs - OtherStruct (line 21) stdout ---- +---- $DIR/failed-doctest-output.rs - OtherStruct (line 22) stdout ---- error[E0425]: cannot find value `no` in this scope - --> $DIR/failed-doctest-output.rs:22:1 + --> $DIR/failed-doctest-output.rs:23:1 | LL | no | ^^ not found in this scope @@ -16,7 +16,7 @@ error: aborting due to previous error For more information about this error, try `rustc --explain E0425`. Couldn't compile the test. ----- $DIR/failed-doctest-output.rs - SomeStruct (line 11) stdout ---- +---- $DIR/failed-doctest-output.rs - SomeStruct (line 12) stdout ---- Test executable failed (exit code 101). stdout: @@ -32,8 +32,8 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: - $DIR/failed-doctest-output.rs - OtherStruct (line 21) - $DIR/failed-doctest-output.rs - SomeStruct (line 11) + $DIR/failed-doctest-output.rs - OtherStruct (line 22) + $DIR/failed-doctest-output.rs - SomeStruct (line 12) -test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out +test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/failed-doctest-should-panic.rs b/src/test/rustdoc-ui/failed-doctest-should-panic.rs index 400fb97804a..2b8bb31686f 100644 --- a/src/test/rustdoc-ui/failed-doctest-should-panic.rs +++ b/src/test/rustdoc-ui/failed-doctest-should-panic.rs @@ -3,6 +3,7 @@ // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // failure-status: 101 /// ```should_panic diff --git a/src/test/rustdoc-ui/failed-doctest-should-panic.stdout b/src/test/rustdoc-ui/failed-doctest-should-panic.stdout index 081b64b50af..57a20092a5d 100644 --- a/src/test/rustdoc-ui/failed-doctest-should-panic.stdout +++ b/src/test/rustdoc-ui/failed-doctest-should-panic.stdout @@ -1,14 +1,14 @@ running 1 test -test $DIR/failed-doctest-should-panic.rs - Foo (line 8) ... FAILED +test $DIR/failed-doctest-should-panic.rs - Foo (line 9) ... FAILED failures: ----- $DIR/failed-doctest-should-panic.rs - Foo (line 8) stdout ---- +---- $DIR/failed-doctest-should-panic.rs - Foo (line 9) stdout ---- Test executable succeeded, but it's marked `should_panic`. failures: - $DIR/failed-doctest-should-panic.rs - Foo (line 8) + $DIR/failed-doctest-should-panic.rs - Foo (line 9) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/intra-doc/.gitattributes b/src/test/rustdoc-ui/intra-doc/.gitattributes new file mode 100644 index 00000000000..6c125fac52f --- /dev/null +++ b/src/test/rustdoc-ui/intra-doc/.gitattributes @@ -0,0 +1 @@ +warning-crlf.rs eol=crlf diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.rs b/src/test/rustdoc-ui/intra-doc/alias-ice.rs index c053e378e71..c053e378e71 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.rs +++ b/src/test/rustdoc-ui/intra-doc/alias-ice.rs diff --git a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr b/src/test/rustdoc-ui/intra-doc/alias-ice.stderr index 771fc2204f5..3db5fad4cfb 100644 --- a/src/test/rustdoc-ui/intra-doc-alias-ice.stderr +++ b/src/test/rustdoc-ui/intra-doc/alias-ice.stderr @@ -1,11 +1,11 @@ error: unresolved link to `TypeAlias::hoge` - --> $DIR/intra-doc-alias-ice.rs:5:30 + --> $DIR/alias-ice.rs:5:30 | LL | /// [broken cross-reference](TypeAlias::hoge) | ^^^^^^^^^^^^^^^ the type alias `TypeAlias` has no associated item named `hoge` | note: the lint level is defined here - --> $DIR/intra-doc-alias-ice.rs:1:9 + --> $DIR/alias-ice.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.rs b/src/test/rustdoc-ui/intra-doc/ambiguity.rs index f63435337cf..f63435337cf 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.rs +++ b/src/test/rustdoc-ui/intra-doc/ambiguity.rs diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-doc/ambiguity.stderr index 21b92a96737..7e967dc88bc 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-doc/ambiguity.stderr @@ -1,14 +1,29 @@ -error: `ambiguous` is both a struct and a function - --> $DIR/intra-links-ambiguity.rs:27:6 +error: `true` is both a module and a builtin type + --> $DIR/ambiguity.rs:38:6 | -LL | /// [`ambiguous`] is ambiguous. - | ^^^^^^^^^^^ ambiguous link +LL | /// [true] + | ^^^^ ambiguous link | note: the lint level is defined here - --> $DIR/intra-links-ambiguity.rs:1:9 + --> $DIR/ambiguity.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ +help: to link to the module, prefix with `mod@` + | +LL | /// [mod@true] + | ^^^^^^^^ +help: to link to the builtin type, prefix with `prim@` + | +LL | /// [prim@true] + | ^^^^^^^^^ + +error: `ambiguous` is both a struct and a function + --> $DIR/ambiguity.rs:27:6 + | +LL | /// [`ambiguous`] is ambiguous. + | ^^^^^^^^^^^ ambiguous link + | help: to link to the struct, prefix with `struct@` | LL | /// [`struct@ambiguous`] is ambiguous. @@ -19,7 +34,7 @@ LL | /// [`ambiguous()`] is ambiguous. | ^^^^^^^^^^^^^ error: `ambiguous` is both a struct and a function - --> $DIR/intra-links-ambiguity.rs:29:6 + --> $DIR/ambiguity.rs:29:6 | LL | /// [ambiguous] is ambiguous. | ^^^^^^^^^ ambiguous link @@ -34,7 +49,7 @@ LL | /// [ambiguous()] is ambiguous. | ^^^^^^^^^^^ error: `multi_conflict` is a struct, a function, and a macro - --> $DIR/intra-links-ambiguity.rs:31:6 + --> $DIR/ambiguity.rs:31:6 | LL | /// [`multi_conflict`] is a three-way conflict. | ^^^^^^^^^^^^^^^^ ambiguous link @@ -53,7 +68,7 @@ LL | /// [`multi_conflict!`] is a three-way conflict. | ^^^^^^^^^^^^^^^^^ error: `type_and_value` is both a module and a constant - --> $DIR/intra-links-ambiguity.rs:33:16 + --> $DIR/ambiguity.rs:33:16 | LL | /// Ambiguous [type_and_value]. | ^^^^^^^^^^^^^^ ambiguous link @@ -68,7 +83,7 @@ LL | /// Ambiguous [const@type_and_value]. | ^^^^^^^^^^^^^^^^^^^^ error: `foo::bar` is both an enum and a function - --> $DIR/intra-links-ambiguity.rs:35:42 + --> $DIR/ambiguity.rs:35:42 | LL | /// Ambiguous non-implied shortcut link [`foo::bar`]. | ^^^^^^^^^^ ambiguous link @@ -82,20 +97,5 @@ help: to link to the function, add parentheses LL | /// Ambiguous non-implied shortcut link [`foo::bar()`]. | ^^^^^^^^^^^^ -error: `true` is both a module and a builtin type - --> $DIR/intra-links-ambiguity.rs:38:6 - | -LL | /// [true] - | ^^^^ ambiguous link - | -help: to link to the module, prefix with `mod@` - | -LL | /// [mod@true] - | ^^^^^^^^ -help: to link to the builtin type, prefix with `prim@` - | -LL | /// [prim@true] - | ^^^^^^^^^ - error: aborting due to 6 previous errors diff --git a/src/test/rustdoc-ui/intra-links-anchors.rs b/src/test/rustdoc-ui/intra-doc/anchors.rs index ccefd2e6fab..ccefd2e6fab 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.rs +++ b/src/test/rustdoc-ui/intra-doc/anchors.rs diff --git a/src/test/rustdoc-ui/intra-links-anchors.stderr b/src/test/rustdoc-ui/intra-doc/anchors.stderr index 1825a4ad1fa..5b272d960d5 100644 --- a/src/test/rustdoc-ui/intra-links-anchors.stderr +++ b/src/test/rustdoc-ui/intra-doc/anchors.stderr @@ -1,29 +1,29 @@ error: `Foo::f#hola` contains an anchor, but links to fields are already anchored - --> $DIR/intra-links-anchors.rs:25:15 + --> $DIR/anchors.rs:25:15 | LL | /// Or maybe [Foo::f#hola]. | ^^^^^^^^^^^ contains invalid anchor | note: the lint level is defined here - --> $DIR/intra-links-anchors.rs:1:9 + --> $DIR/anchors.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ error: `hello#people#!` contains multiple anchors - --> $DIR/intra-links-anchors.rs:31:28 + --> $DIR/anchors.rs:31:28 | LL | /// Another anchor error: [hello#people#!]. | ^^^^^^^^^^^^^^ contains invalid anchor error: `Enum::A#whatever` contains an anchor, but links to variants are already anchored - --> $DIR/intra-links-anchors.rs:37:28 + --> $DIR/anchors.rs:37:28 | LL | /// Damn enum's variants: [Enum::A#whatever]. | ^^^^^^^^^^^^^^^^ contains invalid anchor error: `u32#hello` contains an anchor, but links to builtin types are already anchored - --> $DIR/intra-links-anchors.rs:43:6 + --> $DIR/anchors.rs:43:6 | LL | /// [u32#hello] | ^^^^^^^^^ contains invalid anchor diff --git a/src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs b/src/test/rustdoc-ui/intra-doc/auxiliary/intra-doc-broken.rs index 31a8310d472..31a8310d472 100644 --- a/src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs +++ b/src/test/rustdoc-ui/intra-doc/auxiliary/intra-doc-broken.rs diff --git a/src/test/rustdoc-ui/intra-doc-broken-reexport.rs b/src/test/rustdoc-ui/intra-doc/broken-reexport.rs index ef261359ebd..ef261359ebd 100644 --- a/src/test/rustdoc-ui/intra-doc-broken-reexport.rs +++ b/src/test/rustdoc-ui/intra-doc/broken-reexport.rs diff --git a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs b/src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.rs index b9c8e033b1b..b9c8e033b1b 100644 --- a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs +++ b/src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.rs diff --git a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr b/src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr index 2e732baf6e0..2f5f3daa297 100644 --- a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr +++ b/src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr @@ -1,18 +1,18 @@ error: incompatible link kind for `S` - --> $DIR/intra-links-disambiguator-mismatch.rs:14:14 + --> $DIR/disambiguator-mismatch.rs:14:14 | LL | /// Link to [struct@S] | ^^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S` | note: the lint level is defined here - --> $DIR/intra-links-disambiguator-mismatch.rs:1:9 + --> $DIR/disambiguator-mismatch.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ = note: this link resolved to an enum, which is not a struct error: incompatible link kind for `S` - --> $DIR/intra-links-disambiguator-mismatch.rs:19:14 + --> $DIR/disambiguator-mismatch.rs:19:14 | LL | /// Link to [mod@S] | ^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S` @@ -20,7 +20,7 @@ LL | /// Link to [mod@S] = note: this link resolved to an enum, which is not a module error: incompatible link kind for `S` - --> $DIR/intra-links-disambiguator-mismatch.rs:24:14 + --> $DIR/disambiguator-mismatch.rs:24:14 | LL | /// Link to [union@S] | ^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S` @@ -28,7 +28,7 @@ LL | /// Link to [union@S] = note: this link resolved to an enum, which is not a union error: incompatible link kind for `S` - --> $DIR/intra-links-disambiguator-mismatch.rs:29:14 + --> $DIR/disambiguator-mismatch.rs:29:14 | LL | /// Link to [trait@S] | ^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S` @@ -36,7 +36,7 @@ LL | /// Link to [trait@S] = note: this link resolved to an enum, which is not a trait error: incompatible link kind for `T` - --> $DIR/intra-links-disambiguator-mismatch.rs:34:14 + --> $DIR/disambiguator-mismatch.rs:34:14 | LL | /// Link to [struct@T] | ^^^^^^^^ help: to link to the trait, prefix with `trait@`: `trait@T` @@ -44,7 +44,7 @@ LL | /// Link to [struct@T] = note: this link resolved to a trait, which is not a struct error: incompatible link kind for `m` - --> $DIR/intra-links-disambiguator-mismatch.rs:39:14 + --> $DIR/disambiguator-mismatch.rs:39:14 | LL | /// Link to [derive@m] | ^^^^^^^^ help: to link to the macro, add an exclamation mark: `m!` @@ -52,7 +52,7 @@ LL | /// Link to [derive@m] = note: this link resolved to a macro, which is not a derive macro error: incompatible link kind for `s` - --> $DIR/intra-links-disambiguator-mismatch.rs:44:14 + --> $DIR/disambiguator-mismatch.rs:44:14 | LL | /// Link to [const@s] | ^^^^^^^ help: to link to the static, prefix with `static@`: `static@s` @@ -60,7 +60,7 @@ LL | /// Link to [const@s] = note: this link resolved to a static, which is not a constant error: incompatible link kind for `c` - --> $DIR/intra-links-disambiguator-mismatch.rs:49:14 + --> $DIR/disambiguator-mismatch.rs:49:14 | LL | /// Link to [static@c] | ^^^^^^^^ help: to link to the constant, prefix with `const@`: `const@c` @@ -68,7 +68,7 @@ LL | /// Link to [static@c] = note: this link resolved to a constant, which is not a static error: incompatible link kind for `c` - --> $DIR/intra-links-disambiguator-mismatch.rs:54:14 + --> $DIR/disambiguator-mismatch.rs:54:14 | LL | /// Link to [fn@c] | ^^^^ help: to link to the constant, prefix with `const@`: `const@c` @@ -76,7 +76,7 @@ LL | /// Link to [fn@c] = note: this link resolved to a constant, which is not a function error: incompatible link kind for `c` - --> $DIR/intra-links-disambiguator-mismatch.rs:59:14 + --> $DIR/disambiguator-mismatch.rs:59:14 | LL | /// Link to [c()] | ^^^ help: to link to the constant, prefix with `const@`: `const@c` @@ -84,7 +84,7 @@ LL | /// Link to [c()] = note: this link resolved to a constant, which is not a function error: incompatible link kind for `f` - --> $DIR/intra-links-disambiguator-mismatch.rs:64:14 + --> $DIR/disambiguator-mismatch.rs:64:14 | LL | /// Link to [const@f] | ^^^^^^^ help: to link to the function, add parentheses: `f()` diff --git a/src/test/rustdoc-ui/intra-link-double-anchor.rs b/src/test/rustdoc-ui/intra-doc/double-anchor.rs index a01211c4f32..a01211c4f32 100644 --- a/src/test/rustdoc-ui/intra-link-double-anchor.rs +++ b/src/test/rustdoc-ui/intra-doc/double-anchor.rs diff --git a/src/test/rustdoc-ui/intra-link-double-anchor.stderr b/src/test/rustdoc-ui/intra-doc/double-anchor.stderr index 3282ec8b793..1cd9231eded 100644 --- a/src/test/rustdoc-ui/intra-link-double-anchor.stderr +++ b/src/test/rustdoc-ui/intra-doc/double-anchor.stderr @@ -1,5 +1,5 @@ warning: `with#anchor#error` contains multiple anchors - --> $DIR/intra-link-double-anchor.rs:5:18 + --> $DIR/double-anchor.rs:5:18 | LL | /// docs [label][with#anchor#error] | ^^^^^^^^^^^^^^^^^ contains invalid anchor diff --git a/src/test/rustdoc-ui/intra-link-errors.rs b/src/test/rustdoc-ui/intra-doc/errors.rs index 81e42643ae8..81e42643ae8 100644 --- a/src/test/rustdoc-ui/intra-link-errors.rs +++ b/src/test/rustdoc-ui/intra-doc/errors.rs diff --git a/src/test/rustdoc-ui/intra-link-errors.stderr b/src/test/rustdoc-ui/intra-doc/errors.stderr index 31e7fc48afd..21c806108e3 100644 --- a/src/test/rustdoc-ui/intra-link-errors.stderr +++ b/src/test/rustdoc-ui/intra-doc/errors.stderr @@ -1,95 +1,95 @@ error: unresolved link to `path::to::nonexistent::module` - --> $DIR/intra-link-errors.rs:7:6 + --> $DIR/errors.rs:7:6 | LL | /// [path::to::nonexistent::module] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in scope | note: the lint level is defined here - --> $DIR/intra-link-errors.rs:1:9 + --> $DIR/errors.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ error: unresolved link to `path::to::nonexistent::macro` - --> $DIR/intra-link-errors.rs:11:6 + --> $DIR/errors.rs:11:6 | LL | /// [path::to::nonexistent::macro!] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in scope error: unresolved link to `path::to::nonexistent::type` - --> $DIR/intra-link-errors.rs:15:6 + --> $DIR/errors.rs:15:6 | LL | /// [type@path::to::nonexistent::type] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `path` in scope error: unresolved link to `std::io::not::here` - --> $DIR/intra-link-errors.rs:19:6 + --> $DIR/errors.rs:19:6 | LL | /// [std::io::not::here] | ^^^^^^^^^^^^^^^^^^ no item named `not` in module `io` error: unresolved link to `std::io::not::here` - --> $DIR/intra-link-errors.rs:23:6 + --> $DIR/errors.rs:23:6 | LL | /// [type@std::io::not::here] | ^^^^^^^^^^^^^^^^^^^^^^^ no item named `not` in module `io` error: unresolved link to `std::io::Error::x` - --> $DIR/intra-link-errors.rs:27:6 + --> $DIR/errors.rs:27:6 | LL | /// [std::io::Error::x] | ^^^^^^^^^^^^^^^^^ the struct `Error` has no field or associated item named `x` error: unresolved link to `std::io::ErrorKind::x` - --> $DIR/intra-link-errors.rs:31:6 + --> $DIR/errors.rs:31:6 | LL | /// [std::io::ErrorKind::x] | ^^^^^^^^^^^^^^^^^^^^^ the enum `ErrorKind` has no variant or associated item named `x` error: unresolved link to `f::A` - --> $DIR/intra-link-errors.rs:35:6 + --> $DIR/errors.rs:35:6 | LL | /// [f::A] | ^^^^ `f` is a function, not a module or type, and cannot have associated items error: unresolved link to `f::A` - --> $DIR/intra-link-errors.rs:39:6 + --> $DIR/errors.rs:39:6 | LL | /// [f::A!] | ^^^^^ `f` is a function, not a module or type, and cannot have associated items error: unresolved link to `S::A` - --> $DIR/intra-link-errors.rs:43:6 + --> $DIR/errors.rs:43:6 | LL | /// [S::A] | ^^^^ the struct `S` has no field or associated item named `A` error: unresolved link to `S::fmt` - --> $DIR/intra-link-errors.rs:47:6 + --> $DIR/errors.rs:47:6 | LL | /// [S::fmt] | ^^^^^^ the struct `S` has no field or associated item named `fmt` error: unresolved link to `E::D` - --> $DIR/intra-link-errors.rs:51:6 + --> $DIR/errors.rs:51:6 | LL | /// [E::D] | ^^^^ the enum `E` has no variant or associated item named `D` error: unresolved link to `u8::not_found` - --> $DIR/intra-link-errors.rs:55:6 + --> $DIR/errors.rs:55:6 | LL | /// [u8::not_found] | ^^^^^^^^^^^^^ the builtin type `u8` has no associated item named `not_found` error: unresolved link to `std::primitive::u8::not_found` - --> $DIR/intra-link-errors.rs:59:6 + --> $DIR/errors.rs:59:6 | LL | /// [std::primitive::u8::not_found] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the builtin type `u8` has no associated item named `not_found` error: unresolved link to `Vec::into_iter` - --> $DIR/intra-link-errors.rs:63:6 + --> $DIR/errors.rs:63:6 | LL | /// [type@Vec::into_iter] | ^^^^^^^^^^^^^^^^^^^ @@ -98,7 +98,7 @@ LL | /// [type@Vec::into_iter] | help: to link to the associated function, add parentheses: `Vec::into_iter()` error: unresolved link to `S` - --> $DIR/intra-link-errors.rs:68:6 + --> $DIR/errors.rs:68:6 | LL | /// [S!] | ^^ @@ -106,8 +106,17 @@ LL | /// [S!] | this link resolves to the struct `S`, which is not in the macro namespace | help: to link to the struct, prefix with `struct@`: `struct@S` +error: unresolved link to `S::h` + --> $DIR/errors.rs:78:6 + | +LL | /// [type@S::h] + | ^^^^^^^^^ + | | + | this link resolves to the associated function `h`, which is not in the type namespace + | help: to link to the associated function, add parentheses: `S::h()` + error: unresolved link to `T::g` - --> $DIR/intra-link-errors.rs:86:6 + --> $DIR/errors.rs:86:6 | LL | /// [type@T::g] | ^^^^^^^^^ @@ -116,22 +125,13 @@ LL | /// [type@T::g] | help: to link to the associated function, add parentheses: `T::g()` error: unresolved link to `T::h` - --> $DIR/intra-link-errors.rs:91:6 + --> $DIR/errors.rs:91:6 | LL | /// [T::h!] | ^^^^^ the trait `T` has no macro named `h` -error: unresolved link to `S::h` - --> $DIR/intra-link-errors.rs:78:6 - | -LL | /// [type@S::h] - | ^^^^^^^^^ - | | - | this link resolves to the associated function `h`, which is not in the type namespace - | help: to link to the associated function, add parentheses: `S::h()` - error: unresolved link to `m` - --> $DIR/intra-link-errors.rs:98:6 + --> $DIR/errors.rs:98:6 | LL | /// [m()] | ^^^ diff --git a/src/test/rustdoc-ui/intra-link-malformed-generics.rs b/src/test/rustdoc-ui/intra-doc/malformed-generics.rs index 9c54092146f..9c54092146f 100644 --- a/src/test/rustdoc-ui/intra-link-malformed-generics.rs +++ b/src/test/rustdoc-ui/intra-doc/malformed-generics.rs diff --git a/src/test/rustdoc-ui/intra-link-malformed-generics.stderr b/src/test/rustdoc-ui/intra-doc/malformed-generics.stderr index fe5d4cd1bbf..2e1b22807bc 100644 --- a/src/test/rustdoc-ui/intra-link-malformed-generics.stderr +++ b/src/test/rustdoc-ui/intra-doc/malformed-generics.stderr @@ -1,89 +1,89 @@ error: unresolved link to `Vec<` - --> $DIR/intra-link-malformed-generics.rs:3:6 + --> $DIR/malformed-generics.rs:3:6 | LL | //! [Vec<] | ^^^^ unbalanced angle brackets | note: the lint level is defined here - --> $DIR/intra-link-malformed-generics.rs:1:9 + --> $DIR/malformed-generics.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ error: unresolved link to `Vec<Box<T` - --> $DIR/intra-link-malformed-generics.rs:4:6 + --> $DIR/malformed-generics.rs:4:6 | LL | //! [Vec<Box<T] | ^^^^^^^^^ unbalanced angle brackets error: unresolved link to `Vec<Box<T>` - --> $DIR/intra-link-malformed-generics.rs:5:6 + --> $DIR/malformed-generics.rs:5:6 | LL | //! [Vec<Box<T>] | ^^^^^^^^^^ unbalanced angle brackets error: unresolved link to `Vec<Box<T>>>` - --> $DIR/intra-link-malformed-generics.rs:6:6 + --> $DIR/malformed-generics.rs:6:6 | LL | //! [Vec<Box<T>>>] | ^^^^^^^^^^^^ unbalanced angle brackets error: unresolved link to `Vec<T>>>` - --> $DIR/intra-link-malformed-generics.rs:7:6 + --> $DIR/malformed-generics.rs:7:6 | LL | //! [Vec<T>>>] | ^^^^^^^^ unbalanced angle brackets error: unresolved link to `<Vec` - --> $DIR/intra-link-malformed-generics.rs:8:6 + --> $DIR/malformed-generics.rs:8:6 | LL | //! [<Vec] | ^^^^ unbalanced angle brackets error: unresolved link to `Vec::<` - --> $DIR/intra-link-malformed-generics.rs:9:6 + --> $DIR/malformed-generics.rs:9:6 | LL | //! [Vec::<] | ^^^^^^ unbalanced angle brackets error: unresolved link to `<T>` - --> $DIR/intra-link-malformed-generics.rs:10:6 + --> $DIR/malformed-generics.rs:10:6 | LL | //! [<T>] | ^^^ missing type for generic parameters error: unresolved link to `<invalid syntax>` - --> $DIR/intra-link-malformed-generics.rs:11:6 + --> $DIR/malformed-generics.rs:11:6 | LL | //! [<invalid syntax>] | ^^^^^^^^^^^^^^^^ missing type for generic parameters error: unresolved link to `Vec:<T>:new` - --> $DIR/intra-link-malformed-generics.rs:12:6 + --> $DIR/malformed-generics.rs:12:6 | LL | //! [Vec:<T>:new()] | ^^^^^^^^^^^^^ has invalid path separator error: unresolved link to `Vec<<T>>` - --> $DIR/intra-link-malformed-generics.rs:13:6 + --> $DIR/malformed-generics.rs:13:6 | LL | //! [Vec<<T>>] | ^^^^^^^^ too many angle brackets error: unresolved link to `Vec<>` - --> $DIR/intra-link-malformed-generics.rs:14:6 + --> $DIR/malformed-generics.rs:14:6 | LL | //! [Vec<>] | ^^^^^ empty angle brackets error: unresolved link to `Vec<<>>` - --> $DIR/intra-link-malformed-generics.rs:15:6 + --> $DIR/malformed-generics.rs:15:6 | LL | //! [Vec<<>>] | ^^^^^^^ too many angle brackets error: unresolved link to `<Vec as IntoIterator>::into_iter` - --> $DIR/intra-link-malformed-generics.rs:18:6 + --> $DIR/malformed-generics.rs:18:6 | LL | //! [<Vec as IntoIterator>::into_iter] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fully-qualified syntax is unsupported @@ -91,7 +91,7 @@ LL | //! [<Vec as IntoIterator>::into_iter] = note: see https://github.com/rust-lang/rust/issues/74563 for more information error: unresolved link to `<Vec<T> as IntoIterator>::iter` - --> $DIR/intra-link-malformed-generics.rs:19:6 + --> $DIR/malformed-generics.rs:19:6 | LL | //! [<Vec<T> as IntoIterator>::iter] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fully-qualified syntax is unsupported diff --git a/src/test/rustdoc-ui/intra-link-prim-conflict.rs b/src/test/rustdoc-ui/intra-doc/prim-conflict.rs index 85738ceae8e..85738ceae8e 100644 --- a/src/test/rustdoc-ui/intra-link-prim-conflict.rs +++ b/src/test/rustdoc-ui/intra-doc/prim-conflict.rs diff --git a/src/test/rustdoc-ui/intra-link-prim-conflict.stderr b/src/test/rustdoc-ui/intra-doc/prim-conflict.stderr index 43587a80021..01275f8d9af 100644 --- a/src/test/rustdoc-ui/intra-link-prim-conflict.stderr +++ b/src/test/rustdoc-ui/intra-doc/prim-conflict.stderr @@ -1,11 +1,11 @@ error: `char` is both a module and a builtin type - --> $DIR/intra-link-prim-conflict.rs:4:6 + --> $DIR/prim-conflict.rs:4:6 | LL | /// [char] | ^^^^ ambiguous link | note: the lint level is defined here - --> $DIR/intra-link-prim-conflict.rs:1:9 + --> $DIR/prim-conflict.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | /// [prim@char] | ^^^^^^^^^ error: `char` is both a module and a builtin type - --> $DIR/intra-link-prim-conflict.rs:10:6 + --> $DIR/prim-conflict.rs:10:6 | LL | /// [type@char] | ^^^^^^^^^ ambiguous link @@ -34,7 +34,7 @@ LL | /// [prim@char] | ^^^^^^^^^ error: incompatible link kind for `char` - --> $DIR/intra-link-prim-conflict.rs:19:6 + --> $DIR/prim-conflict.rs:19:6 | LL | /// [struct@char] | ^^^^^^^^^^^ help: to link to the module, prefix with `mod@`: `mod@char` @@ -42,7 +42,7 @@ LL | /// [struct@char] = note: this link resolved to a module, which is not a struct error: incompatible link kind for `char` - --> $DIR/intra-link-prim-conflict.rs:26:10 + --> $DIR/prim-conflict.rs:26:10 | LL | //! [struct@char] | ^^^^^^^^^^^ help: to link to the builtin type, prefix with `prim@`: `prim@char` diff --git a/src/test/rustdoc-ui/intra-links-private.private.stderr b/src/test/rustdoc-ui/intra-doc/private.private.stderr index eeef24b4797..6e11ec3e87b 100644 --- a/src/test/rustdoc-ui/intra-links-private.private.stderr +++ b/src/test/rustdoc-ui/intra-doc/private.private.stderr @@ -1,5 +1,5 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` - --> $DIR/intra-links-private.rs:5:11 + --> $DIR/private.rs:5:11 | LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private diff --git a/src/test/rustdoc-ui/intra-links-private.public.stderr b/src/test/rustdoc-ui/intra-doc/private.public.stderr index 3f7b17586f1..3a6a4b66452 100644 --- a/src/test/rustdoc-ui/intra-links-private.public.stderr +++ b/src/test/rustdoc-ui/intra-doc/private.public.stderr @@ -1,5 +1,5 @@ warning: public documentation for `DocMe` links to private item `DontDocMe` - --> $DIR/intra-links-private.rs:5:11 + --> $DIR/private.rs:5:11 | LL | /// docs [DontDocMe] | ^^^^^^^^^ this item is private diff --git a/src/test/rustdoc-ui/intra-links-private.rs b/src/test/rustdoc-ui/intra-doc/private.rs index 613236d75d2..613236d75d2 100644 --- a/src/test/rustdoc-ui/intra-links-private.rs +++ b/src/test/rustdoc-ui/intra-doc/private.rs diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs b/src/test/rustdoc-ui/intra-doc/span-ice-55723.rs index 7764a6df6ee..7764a6df6ee 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.rs +++ b/src/test/rustdoc-ui/intra-doc/span-ice-55723.rs diff --git a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr b/src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr index d8afa9e7efd..10ca14e850f 100644 --- a/src/test/rustdoc-ui/intra-link-span-ice-55723.stderr +++ b/src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr @@ -1,11 +1,11 @@ error: unresolved link to `i` - --> $DIR/intra-link-span-ice-55723.rs:9:10 + --> $DIR/span-ice-55723.rs:9:10 | LL | /// (arr[i]) | ^ no item named `i` in scope | note: the lint level is defined here - --> $DIR/intra-link-span-ice-55723.rs:1:9 + --> $DIR/span-ice-55723.rs:1:9 | LL | #![deny(broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/rustdoc-ui/intra-links-warning-crlf.rs b/src/test/rustdoc-ui/intra-doc/warning-crlf.rs index a19c33b53be..a19c33b53be 100644 --- a/src/test/rustdoc-ui/intra-links-warning-crlf.rs +++ b/src/test/rustdoc-ui/intra-doc/warning-crlf.rs diff --git a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr b/src/test/rustdoc-ui/intra-doc/warning-crlf.stderr index 67c48378fd2..01e42820037 100644 --- a/src/test/rustdoc-ui/intra-links-warning-crlf.stderr +++ b/src/test/rustdoc-ui/intra-doc/warning-crlf.stderr @@ -1,5 +1,5 @@ warning: unresolved link to `error` - --> $DIR/intra-links-warning-crlf.rs:7:6 + --> $DIR/warning-crlf.rs:7:6 | LL | /// [error] | ^^^^^ no item named `error` in scope @@ -8,7 +8,7 @@ LL | /// [error] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error1` - --> $DIR/intra-links-warning-crlf.rs:12:11 + --> $DIR/warning-crlf.rs:12:11 | LL | /// docs [error1] | ^^^^^^ no item named `error1` in scope @@ -16,7 +16,7 @@ LL | /// docs [error1] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error2` - --> $DIR/intra-links-warning-crlf.rs:15:11 + --> $DIR/warning-crlf.rs:15:11 | LL | /// docs [error2] | ^^^^^^ no item named `error2` in scope @@ -24,7 +24,7 @@ LL | /// docs [error2] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/intra-links-warning-crlf.rs:23:20 + --> $DIR/warning-crlf.rs:23:20 | LL | * It also has an [error]. | ^^^^^ no item named `error` in scope diff --git a/src/test/rustdoc-ui/intra-links-warning.rs b/src/test/rustdoc-ui/intra-doc/warning.rs index eab1f034804..eab1f034804 100644 --- a/src/test/rustdoc-ui/intra-links-warning.rs +++ b/src/test/rustdoc-ui/intra-doc/warning.rs diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-doc/warning.stderr index 4cdb8bbdde7..430d18165a0 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-doc/warning.stderr @@ -1,5 +1,5 @@ warning: unresolved link to `Foo::baz` - --> $DIR/intra-links-warning.rs:3:23 + --> $DIR/warning.rs:3:23 | LL | //! Test with [Foo::baz], [Bar::foo], ... | ^^^^^^^^ the struct `Foo` has no field or associated item named `baz` @@ -7,45 +7,99 @@ LL | //! Test with [Foo::baz], [Bar::foo], ... = note: `#[warn(broken_intra_doc_links)]` on by default warning: unresolved link to `Bar::foo` - --> $DIR/intra-links-warning.rs:3:35 + --> $DIR/warning.rs:3:35 | LL | //! Test with [Foo::baz], [Bar::foo], ... | ^^^^^^^^ no item named `Bar` in scope warning: unresolved link to `Uniooon::X` - --> $DIR/intra-links-warning.rs:6:13 + --> $DIR/warning.rs:6:13 | LL | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^^^^^ no item named `Uniooon` in scope warning: unresolved link to `Qux::Z` - --> $DIR/intra-links-warning.rs:6:30 + --> $DIR/warning.rs:6:30 | LL | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^ no item named `Qux` in scope warning: unresolved link to `Uniooon::X` - --> $DIR/intra-links-warning.rs:10:14 + --> $DIR/warning.rs:10:14 | LL | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^^^^^ no item named `Uniooon` in scope warning: unresolved link to `Qux::Z` - --> $DIR/intra-links-warning.rs:10:31 + --> $DIR/warning.rs:10:31 | LL | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^ no item named `Qux` in scope warning: unresolved link to `Qux:Y` - --> $DIR/intra-links-warning.rs:14:13 + --> $DIR/warning.rs:14:13 | LL | /// [Qux:Y] | ^^^^^ no item named `Qux:Y` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` +warning: unresolved link to `BarA` + --> $DIR/warning.rs:21:10 + | +LL | /// bar [BarA] bar + | ^^^^ no item named `BarA` in scope + | + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +warning: unresolved link to `BarB` + --> $DIR/warning.rs:27:9 + | +LL | * bar [BarB] bar + | ^^^^ no item named `BarB` in scope + | + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +warning: unresolved link to `BarC` + --> $DIR/warning.rs:34:6 + | +LL | bar [BarC] bar + | ^^^^ no item named `BarC` in scope + | + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +warning: unresolved link to `BarD` + --> $DIR/warning.rs:45:1 + | +LL | #[doc = "Foo\nbar [BarD] bar\nbaz"] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: the link appears in this line: + + bar [BarD] bar + ^^^^ + = note: no item named `BarD` in scope + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +warning: unresolved link to `BarF` + --> $DIR/warning.rs:50:9 + | +LL | #[doc = $f] + | ^^^^^^^^^^^ +... +LL | f!("Foo\nbar [BarF] bar\nbaz"); + | ------------------------------- in this macro invocation + | + = note: the link appears in this line: + + bar [BarF] bar + ^^^^ + = note: no item named `BarF` in scope + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + warning: unresolved link to `error` - --> $DIR/intra-links-warning.rs:58:30 + --> $DIR/warning.rs:58:30 | LL | * time to introduce a link [error]*/ | ^^^^^ no item named `error` in scope @@ -53,7 +107,7 @@ LL | * time to introduce a link [error]*/ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/intra-links-warning.rs:64:30 + --> $DIR/warning.rs:64:30 | LL | * time to introduce a link [error] | ^^^^^ no item named `error` in scope @@ -61,7 +115,7 @@ LL | * time to introduce a link [error] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/intra-links-warning.rs:68:1 + --> $DIR/warning.rs:68:1 | LL | #[doc = "single line [error]"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -74,7 +128,7 @@ LL | #[doc = "single line [error]"] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/intra-links-warning.rs:71:1 + --> $DIR/warning.rs:71:1 | LL | #[doc = "single line with \"escaping\" [error]"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -87,7 +141,7 @@ LL | #[doc = "single line with \"escaping\" [error]"] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error` - --> $DIR/intra-links-warning.rs:74:1 + --> $DIR/warning.rs:74:1 | LL | / /// Item docs. LL | | #[doc="Hello there!"] @@ -102,7 +156,7 @@ LL | | /// [error] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error1` - --> $DIR/intra-links-warning.rs:80:11 + --> $DIR/warning.rs:80:11 | LL | /// docs [error1] | ^^^^^^ no item named `error1` in scope @@ -110,66 +164,12 @@ LL | /// docs [error1] = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `error2` - --> $DIR/intra-links-warning.rs:82:11 + --> $DIR/warning.rs:82:11 | LL | /// docs [error2] | ^^^^^^ no item named `error2` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` -warning: unresolved link to `BarA` - --> $DIR/intra-links-warning.rs:21:10 - | -LL | /// bar [BarA] bar - | ^^^^ no item named `BarA` in scope - | - = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` - -warning: unresolved link to `BarB` - --> $DIR/intra-links-warning.rs:27:9 - | -LL | * bar [BarB] bar - | ^^^^ no item named `BarB` in scope - | - = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` - -warning: unresolved link to `BarC` - --> $DIR/intra-links-warning.rs:34:6 - | -LL | bar [BarC] bar - | ^^^^ no item named `BarC` in scope - | - = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` - -warning: unresolved link to `BarD` - --> $DIR/intra-links-warning.rs:45:1 - | -LL | #[doc = "Foo\nbar [BarD] bar\nbaz"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the link appears in this line: - - bar [BarD] bar - ^^^^ - = note: no item named `BarD` in scope - = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` - -warning: unresolved link to `BarF` - --> $DIR/intra-links-warning.rs:50:9 - | -LL | #[doc = $f] - | ^^^^^^^^^^^ -... -LL | f!("Foo\nbar [BarF] bar\nbaz"); - | ------------------------------- in this macro invocation - | - = note: the link appears in this line: - - bar [BarF] bar - ^^^^ - = note: no item named `BarF` in scope - = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` - = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - warning: 19 warnings emitted diff --git a/src/test/rustdoc-ui/invalid-keyword.rs b/src/test/rustdoc-ui/invalid-keyword.rs new file mode 100644 index 00000000000..ce2abc69bbd --- /dev/null +++ b/src/test/rustdoc-ui/invalid-keyword.rs @@ -0,0 +1,4 @@ +#![feature(doc_keyword)] + +#[doc(keyword = "foo df")] //~ ERROR +mod foo {} diff --git a/src/test/rustdoc-ui/invalid-keyword.stderr b/src/test/rustdoc-ui/invalid-keyword.stderr new file mode 100644 index 00000000000..8658e382578 --- /dev/null +++ b/src/test/rustdoc-ui/invalid-keyword.stderr @@ -0,0 +1,8 @@ +error: `foo df` is not a valid identifier + --> $DIR/invalid-keyword.rs:3:17 + | +LL | #[doc(keyword = "foo df")] + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr index 32756c99e7f..e02ed4a056c 100644 --- a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr +++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr @@ -1,8 +1,9 @@ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:49:1 + --> $DIR/lint-missing-doc-code-example.rs:19:1 | -LL | /// Doc - | ^^^^^^^ +LL | / mod module1 { +LL | | } + | |_^ | note: the lint level is defined here --> $DIR/lint-missing-doc-code-example.rs:2:9 @@ -11,29 +12,28 @@ LL | #![deny(missing_doc_code_examples)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:63:1 + --> $DIR/lint-missing-doc-code-example.rs:37:3 | -LL | /// Doc - | ^^^^^^^ +LL | /// doc + | ^^^^^^^ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:56:1 + --> $DIR/lint-missing-doc-code-example.rs:49:1 | LL | /// Doc | ^^^^^^^ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:19:1 + --> $DIR/lint-missing-doc-code-example.rs:56:1 | -LL | / mod module1 { -LL | | } - | |_^ +LL | /// Doc + | ^^^^^^^ error: missing code example in this documentation - --> $DIR/lint-missing-doc-code-example.rs:37:3 + --> $DIR/lint-missing-doc-code-example.rs:63:1 | -LL | /// doc - | ^^^^^^^ +LL | /// Doc + | ^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/rustdoc-ui/test-no_std.rs b/src/test/rustdoc-ui/test-no_std.rs index af4843ad324..ee919985e7a 100644 --- a/src/test/rustdoc-ui/test-no_std.rs +++ b/src/test/rustdoc-ui/test-no_std.rs @@ -1,5 +1,6 @@ // compile-flags:--test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // check-pass #![no_std] diff --git a/src/test/rustdoc-ui/test-no_std.stdout b/src/test/rustdoc-ui/test-no_std.stdout index 9cdcac2a483..8d5a30804c1 100644 --- a/src/test/rustdoc-ui/test-no_std.stdout +++ b/src/test/rustdoc-ui/test-no_std.stdout @@ -1,6 +1,6 @@ running 1 test -test $DIR/test-no_std.rs - f (line 9) ... ok +test $DIR/test-no_std.rs - f (line 10) ... ok -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME diff --git a/src/test/rustdoc-ui/unparseable-doc-test.rs b/src/test/rustdoc-ui/unparseable-doc-test.rs index 18d6b32bf40..0cff8cd9a33 100644 --- a/src/test/rustdoc-ui/unparseable-doc-test.rs +++ b/src/test/rustdoc-ui/unparseable-doc-test.rs @@ -1,5 +1,6 @@ // compile-flags: --test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" // failure-status: 101 // rustc-env: RUST_BACKTRACE=0 diff --git a/src/test/rustdoc-ui/unparseable-doc-test.stdout b/src/test/rustdoc-ui/unparseable-doc-test.stdout index 29cb22e2e4b..2641c66f25e 100644 --- a/src/test/rustdoc-ui/unparseable-doc-test.stdout +++ b/src/test/rustdoc-ui/unparseable-doc-test.stdout @@ -1,12 +1,12 @@ running 1 test -test $DIR/unparseable-doc-test.rs - foo (line 6) ... FAILED +test $DIR/unparseable-doc-test.rs - foo (line 7) ... FAILED failures: ----- $DIR/unparseable-doc-test.rs - foo (line 6) stdout ---- +---- $DIR/unparseable-doc-test.rs - foo (line 7) stdout ---- error[E0765]: unterminated double quote string - --> $DIR/unparseable-doc-test.rs:8:1 + --> $DIR/unparseable-doc-test.rs:9:1 | LL | "unterminated | ^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ For more information about this error, try `rustc --explain E0765`. Couldn't compile the test. failures: - $DIR/unparseable-doc-test.rs - foo (line 6) + $DIR/unparseable-doc-test.rs - foo (line 7) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME |
