diff --git a/src/test/rustdoc-ui/doc-without-codeblock.stderr b/src/test/rustdoc-ui/doc-without-codeblock.stderr index f2b2328322a7b..3372304f44a3d 100644 --- a/src/test/rustdoc-ui/doc-without-codeblock.stderr +++ b/src/test/rustdoc-ui/doc-without-codeblock.stderr @@ -16,12 +16,6 @@ note: the lint level is defined here 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 | @@ -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/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index 21b92a9673755..936055da01cf7 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-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/intra-links-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 | 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/intra-links-ambiguity.rs:27:6 + | +LL | /// [`ambiguous`] is ambiguous. + | ^^^^^^^^^^^ ambiguous link + | help: to link to the struct, prefix with `struct@` | LL | /// [`struct@ambiguous`] is ambiguous. @@ -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-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index 4cdb8bbdde782..bf437a7cf4674 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -36,6 +36,60 @@ warning: unresolved link to `Qux::Z` LL | //! , [Uniooon::X] and [Qux::Z]. | ^^^^^^ no item named `Qux` in scope +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: unresolved link to `Qux:Y` --> $DIR/intra-links-warning.rs:14:13 | @@ -117,59 +171,5 @@ LL | /// docs [error2] | = 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/lint-missing-doc-code-example.stderr b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr index 32756c99e7f9f..e02ed4a056c12 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