about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-04-14 16:59:41 -0400
committerJoshua Nelson <jyn514@gmail.com>2021-04-17 16:03:03 -0400
commit59546efaa3bbbad5fdcd2a95346c87f5bb2b9511 (patch)
treea660e0b6a94af49ab2677f9fbbd97ce1867ec8c5 /src/test
parent9c3b66cff74f3a21dc735294f3df319a38bc2114 (diff)
downloadrust-59546efaa3bbbad5fdcd2a95346c87f5bb2b9511.tar.gz
rust-59546efaa3bbbad5fdcd2a95346c87f5bb2b9511.zip
rustdoc: Give a more accurate span for anchor failures
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-ui/intra-doc/anchors.stderr20
-rw-r--r--src/test/rustdoc-ui/intra-doc/double-anchor.stderr4
2 files changed, 18 insertions, 6 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/anchors.stderr b/src/test/rustdoc-ui/intra-doc/anchors.stderr
index 42a8832185a..d63e1ee60b3 100644
--- a/src/test/rustdoc-ui/intra-doc/anchors.stderr
+++ b/src/test/rustdoc-ui/intra-doc/anchors.stderr
@@ -2,7 +2,9 @@ error: `prim@usize#x` contains an anchor, but links to builtin types are already
   --> $DIR/anchors.rs:47:6
    |
 LL | /// [prim@usize#x]
-   |      ^^^^^^^^^^^^ contains invalid anchor
+   |      ^^^^^^^^^^--
+   |                |
+   |                invalid anchor
    |
 note: the lint level is defined here
   --> $DIR/anchors.rs:1:9
@@ -16,25 +18,33 @@ error: `Foo::f#hola` contains an anchor, but links to fields are already anchore
   --> $DIR/anchors.rs:25:15
    |
 LL | /// Or maybe [Foo::f#hola].
-   |               ^^^^^^^^^^^ contains invalid anchor
+   |               ^^^^^^-----
+   |                     |
+   |                     invalid anchor
 
 error: `hello#people#!` contains multiple anchors
   --> $DIR/anchors.rs:31:28
    |
 LL | /// Another anchor error: [hello#people#!].
-   |                            ^^^^^^^^^^^^^^ contains invalid anchor
+   |                            ^^^^^^^^^^^^--
+   |                                        |
+   |                                        invalid anchor
 
 error: `Enum::A#whatever` contains an anchor, but links to variants are already anchored
   --> $DIR/anchors.rs:37:28
    |
 LL | /// Damn enum's variants: [Enum::A#whatever].
-   |                            ^^^^^^^^^^^^^^^^ contains invalid anchor
+   |                            ^^^^^^^---------
+   |                                   |
+   |                                   invalid anchor
 
 error: `u32#hello` contains an anchor, but links to builtin types are already anchored
   --> $DIR/anchors.rs:43:6
    |
 LL | /// [u32#hello]
-   |      ^^^^^^^^^ contains invalid anchor
+   |      ^^^------
+   |         |
+   |         invalid anchor
    |
    = note: this restriction may be lifted in a future release
    = note: see https://github.com/rust-lang/rust/issues/83083 for more information
diff --git a/src/test/rustdoc-ui/intra-doc/double-anchor.stderr b/src/test/rustdoc-ui/intra-doc/double-anchor.stderr
index c0241b98b78..6addb010e07 100644
--- a/src/test/rustdoc-ui/intra-doc/double-anchor.stderr
+++ b/src/test/rustdoc-ui/intra-doc/double-anchor.stderr
@@ -2,7 +2,9 @@ warning: `with#anchor#error` contains multiple anchors
   --> $DIR/double-anchor.rs:5:18
    |
 LL | /// docs [label][with#anchor#error]
-   |                  ^^^^^^^^^^^^^^^^^ contains invalid anchor
+   |                  ^^^^^^^^^^^------
+   |                             |
+   |                             invalid anchor
    |
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default