about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-11-28 21:10:37 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-11-28 21:14:09 -0500
commit872acb0c3589450a10f6fec97cd1a781e2d17794 (patch)
treefcaae899a1b811229cf44b243b1cdbc8638368a7
parentddfb581fb9e04595bc7cdb9d66792fdfdbec67ed (diff)
downloadrust-872acb0c3589450a10f6fec97cd1a781e2d17794.tar.gz
rust-872acb0c3589450a10f6fec97cd1a781e2d17794.zip
Move `src/test/rustdoc-ui` intra-doc tests into a subdirectory
This also changes the builder to allow using
`x.py test src/test/rustdoc-ui/intra-doc`; before, it would panic that
no paths were found.
-rw-r--r--src/bootstrap/test.rs33
-rw-r--r--src/test/rustdoc-ui/.gitattributes1
-rw-r--r--src/test/rustdoc-ui/intra-doc/.gitattributes1
-rw-r--r--src/test/rustdoc-ui/intra-doc/alias-ice.rs (renamed from src/test/rustdoc-ui/intra-doc-alias-ice.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/alias-ice.stderr (renamed from src/test/rustdoc-ui/intra-doc-alias-ice.stderr)4
-rw-r--r--src/test/rustdoc-ui/intra-doc/ambiguity.rs (renamed from src/test/rustdoc-ui/intra-links-ambiguity.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/ambiguity.stderr (renamed from src/test/rustdoc-ui/intra-links-ambiguity.stderr)14
-rw-r--r--src/test/rustdoc-ui/intra-doc/anchors.rs (renamed from src/test/rustdoc-ui/intra-links-anchors.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/anchors.stderr (renamed from src/test/rustdoc-ui/intra-links-anchors.stderr)10
-rw-r--r--src/test/rustdoc-ui/intra-doc/auxiliary/intra-doc-broken.rs (renamed from src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/broken-reexport.rs (renamed from src/test/rustdoc-ui/intra-doc-broken-reexport.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.rs (renamed from src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/disambiguator-mismatch.stderr (renamed from src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr)24
-rw-r--r--src/test/rustdoc-ui/intra-doc/double-anchor.rs (renamed from src/test/rustdoc-ui/intra-link-double-anchor.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/double-anchor.stderr (renamed from src/test/rustdoc-ui/intra-link-double-anchor.stderr)2
-rw-r--r--src/test/rustdoc-ui/intra-doc/errors.rs (renamed from src/test/rustdoc-ui/intra-link-errors.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/errors.stderr (renamed from src/test/rustdoc-ui/intra-link-errors.stderr)42
-rw-r--r--src/test/rustdoc-ui/intra-doc/malformed-generics.rs (renamed from src/test/rustdoc-ui/intra-link-malformed-generics.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/malformed-generics.stderr (renamed from src/test/rustdoc-ui/intra-link-malformed-generics.stderr)32
-rw-r--r--src/test/rustdoc-ui/intra-doc/prim-conflict.rs (renamed from src/test/rustdoc-ui/intra-link-prim-conflict.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/prim-conflict.stderr (renamed from src/test/rustdoc-ui/intra-link-prim-conflict.stderr)10
-rw-r--r--src/test/rustdoc-ui/intra-doc/private.private.stderr (renamed from src/test/rustdoc-ui/intra-links-private.private.stderr)2
-rw-r--r--src/test/rustdoc-ui/intra-doc/private.public.stderr (renamed from src/test/rustdoc-ui/intra-links-private.public.stderr)2
-rw-r--r--src/test/rustdoc-ui/intra-doc/private.rs (renamed from src/test/rustdoc-ui/intra-links-private.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/span-ice-55723.rs (renamed from src/test/rustdoc-ui/intra-link-span-ice-55723.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr (renamed from src/test/rustdoc-ui/intra-link-span-ice-55723.stderr)4
-rw-r--r--src/test/rustdoc-ui/intra-doc/warning-crlf.rs (renamed from src/test/rustdoc-ui/intra-links-warning-crlf.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/warning-crlf.stderr (renamed from src/test/rustdoc-ui/intra-links-warning-crlf.stderr)8
-rw-r--r--src/test/rustdoc-ui/intra-doc/warning.rs (renamed from src/test/rustdoc-ui/intra-links-warning.rs)0
-rw-r--r--src/test/rustdoc-ui/intra-doc/warning.stderr (renamed from src/test/rustdoc-ui/intra-links-warning.stderr)38
30 files changed, 98 insertions, 129 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index e087e2b8ff1..dad36640dbf 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -688,38 +688,6 @@ impl Step for RustdocJSNotStd {
     }
 }
 
-#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
-pub struct RustdocUi {
-    pub target: TargetSelection,
-    pub compiler: Compiler,
-}
-
-impl Step for RustdocUi {
-    type Output = ();
-    const DEFAULT: bool = true;
-    const ONLY_HOSTS: bool = true;
-
-    fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-        run.path("src/test/rustdoc-ui")
-    }
-
-    fn make_run(run: RunConfig<'_>) {
-        let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple());
-        run.builder.ensure(RustdocUi { target: run.target, compiler });
-    }
-
-    fn run(self, builder: &Builder<'_>) {
-        builder.ensure(Compiletest {
-            compiler: self.compiler,
-            target: self.target,
-            mode: "ui",
-            suite: "rustdoc-ui",
-            path: "src/test/rustdoc-ui",
-            compare_mode: None,
-        })
-    }
-}
-
 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
 pub struct Tidy;
 
@@ -934,6 +902,7 @@ default_test!(Debuginfo { path: "src/test/debuginfo", mode: "debuginfo", suite:
 host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-fulldeps" });
 
 host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" });
+host_test!(RustdocUi { path: "src/test/rustdoc-ui", mode: "ui", suite: "rustdoc-ui" });
 
 host_test!(Pretty { path: "src/test/pretty", mode: "pretty", suite: "pretty" });
 
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/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 936055da01c..7e967dc88bc 100644
--- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr
+++ b/src/test/rustdoc-ui/intra-doc/ambiguity.stderr
@@ -1,11 +1,11 @@
 error: `true` is both a module and a builtin type
-  --> $DIR/intra-links-ambiguity.rs:38:6
+  --> $DIR/ambiguity.rs:38:6
    |
 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)]
    |         ^^^^^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | /// [prim@true]
    |      ^^^^^^^^^
 
 error: `ambiguous` is both a struct and a function
-  --> $DIR/intra-links-ambiguity.rs:27:6
+  --> $DIR/ambiguity.rs:27:6
    |
 LL | /// [`ambiguous`] is ambiguous.
    |      ^^^^^^^^^^^ ambiguous link
@@ -34,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
@@ -49,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
@@ -68,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
@@ -83,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
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 be98cac94ec..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!]
    |      ^^
@@ -107,7 +107,7 @@ LL | /// [S!]
    |      help: to link to the struct, prefix with `struct@`: `struct@S`
 
 error: unresolved link to `S::h`
-  --> $DIR/intra-link-errors.rs:78:6
+  --> $DIR/errors.rs:78:6
    |
 LL | /// [type@S::h]
    |      ^^^^^^^^^
@@ -116,7 +116,7 @@ LL | /// [type@S::h]
    |      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]
    |      ^^^^^^^^^
@@ -125,13 +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 `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 0b074e9d53e..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,37 +7,37 @@ 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
@@ -45,7 +45,7 @@ LL |        /// [Qux:Y]
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
 
 warning: unresolved link to `BarA`
-  --> $DIR/intra-links-warning.rs:21:10
+  --> $DIR/warning.rs:21:10
    |
 LL | /// bar [BarA] bar
    |          ^^^^ no item named `BarA` in scope
@@ -53,7 +53,7 @@ LL | /// bar [BarA] bar
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
 
 warning: unresolved link to `BarB`
-  --> $DIR/intra-links-warning.rs:27:9
+  --> $DIR/warning.rs:27:9
    |
 LL |  * bar [BarB] bar
    |         ^^^^ no item named `BarB` in scope
@@ -61,7 +61,7 @@ LL |  * bar [BarB] bar
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
 
 warning: unresolved link to `BarC`
-  --> $DIR/intra-links-warning.rs:34:6
+  --> $DIR/warning.rs:34:6
    |
 LL | bar [BarC] bar
    |      ^^^^ no item named `BarC` in scope
@@ -69,7 +69,7 @@ LL | bar [BarC] bar
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
 
 warning: unresolved link to `BarD`
-  --> $DIR/intra-links-warning.rs:45:1
+  --> $DIR/warning.rs:45:1
    |
 LL | #[doc = "Foo\nbar [BarD] bar\nbaz"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -82,7 +82,7 @@ LL | #[doc = "Foo\nbar [BarD] bar\nbaz"]
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
 
 warning: unresolved link to `BarF`
-  --> $DIR/intra-links-warning.rs:50:9
+  --> $DIR/warning.rs:50:9
    |
 LL |         #[doc = $f]
    |         ^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL | f!("Foo\nbar [BarF] bar\nbaz");
    = 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
@@ -107,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
@@ -115,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]"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,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]"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -141,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!"]
@@ -156,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
@@ -164,7 +164,7 @@ 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