about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2024-02-17 12:19:08 +0000
committerAlex Macleod <alex@macleod.io>2024-02-17 12:34:54 +0000
commit740d89ee697de31ad4ede7e8b6596c148f6659c2 (patch)
tree25744aed86d569442f3a2efe3d8a8f3f8a6a1b4e
parent1d107ab2be2e6c735c32451e9f27a0275babd954 (diff)
downloadrust-740d89ee697de31ad4ede7e8b6596c148f6659c2.tar.gz
rust-740d89ee697de31ad4ede7e8b6596c148f6659c2.zip
Remove $DIR replacement in docs sampling stderr files
-rw-r--r--book/src/development/emitting_lints.md10
-rw-r--r--book/src/development/writing_tests.md6
-rw-r--r--clippy_utils/src/diagnostics.rs10
3 files changed, 13 insertions, 13 deletions
diff --git a/book/src/development/emitting_lints.md b/book/src/development/emitting_lints.md
index a12f6aa91b3..d70f4fc17eb 100644
--- a/book/src/development/emitting_lints.md
+++ b/book/src/development/emitting_lints.md
@@ -82,7 +82,7 @@ The output looks something like this (from the example earlier):
 
 ```text
 error: an inclusive range would be more readable
-  --> $DIR/range_plus_minus_one.rs:37:14
+  --> tests/ui/range_plus_minus_one.rs:37:14
    |
 LL |     for _ in 1..1 + 1 {}
    |              ^^^^^^^^ help: use: `1..=1`
@@ -135,14 +135,14 @@ Examples:
 
 ```text
 error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
-  --> $DIR/drop_forget_ref.rs:10:5
+  --> tests/ui/drop_forget_ref.rs:10:5
    |
 10 |     forget(&SomeStruct);
    |     ^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::forget-ref` implied by `-D warnings`
 note: argument has type &SomeStruct
-  --> $DIR/drop_forget_ref.rs:10:12
+  --> tests/ui/drop_forget_ref.rs:10:12
    |
 10 |     forget(&SomeStruct);
    |            ^^^^^^^^^^^
@@ -158,7 +158,7 @@ Example:
 
 ```text
 error: constant division of 0.0 with 0.0 will always result in NaN
-  --> $DIR/zero_div_zero.rs:6:25
+  --> tests/ui/zero_div_zero.rs:6:25
    |
 6  |     let other_f64_nan = 0.0f64 / 0.0;
    |                         ^^^^^^^^^^^^
@@ -176,7 +176,7 @@ Example:
 
 ```text
 error: This `.fold` can be more succinctly expressed as `.any`
---> $DIR/methods.rs:390:13
+--> tests/ui/methods.rs:390:13
     |
 390 |     let _ = (0..3).fold(false, |acc, x| acc || x > 2);
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)`
diff --git a/book/src/development/writing_tests.md b/book/src/development/writing_tests.md
index 8937e0d8e94..39a5ad96688 100644
--- a/book/src/development/writing_tests.md
+++ b/book/src/development/writing_tests.md
@@ -97,19 +97,19 @@ failures:
 ---- compile_test stdout ----
 normalized stderr:
 error: function called "foo"
-  --> $DIR/foo_functions.rs:6:12
+  --> tests/ui/foo_functions.rs:6:12
    |
 LL |     pub fn foo(&self) {}
    |            ^^^
    |
    = note: `-D clippy::foo-functions` implied by `-D warnings`
 error: function called "foo"
-  --> $DIR/foo_functions.rs:13:8
+  --> tests/ui/foo_functions.rs:13:8
    |
 LL |     fn foo(&self) {}
    |        ^^^
 error: function called "foo"
-  --> $DIR/foo_functions.rs:19:4
+  --> tests/ui/foo_functions.rs:19:4
    |
 LL | fn foo() {}
    |    ^^^
diff --git a/clippy_utils/src/diagnostics.rs b/clippy_utils/src/diagnostics.rs
index 5199959c0f2..8cbbe87ef07 100644
--- a/clippy_utils/src/diagnostics.rs
+++ b/clippy_utils/src/diagnostics.rs
@@ -40,7 +40,7 @@ fn docs_link(diag: &mut Diagnostic, lint: &'static Lint) {
 ///
 /// ```ignore
 /// error: usage of mem::forget on Drop type
-///   --> $DIR/mem_forget.rs:17:5
+///   --> tests/ui/mem_forget.rs:17:5
 ///    |
 /// 17 |     std::mem::forget(seven);
 ///    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -65,7 +65,7 @@ pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<Mult
 ///
 /// ```text
 /// error: constant division of 0.0 with 0.0 will always result in NaN
-///   --> $DIR/zero_div_zero.rs:6:25
+///   --> tests/ui/zero_div_zero.rs:6:25
 ///    |
 /// 6  |     let other_f64_nan = 0.0f64 / 0.0;
 ///    |                         ^^^^^^^^^^^^
@@ -103,14 +103,14 @@ pub fn span_lint_and_help<T: LintContext>(
 ///
 /// ```text
 /// error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
-///   --> $DIR/drop_forget_ref.rs:10:5
+///   --> tests/ui/drop_forget_ref.rs:10:5
 ///    |
 /// 10 |     forget(&SomeStruct);
 ///    |     ^^^^^^^^^^^^^^^^^^^
 ///    |
 ///    = note: `-D clippy::forget-ref` implied by `-D warnings`
 /// note: argument has type &SomeStruct
-///   --> $DIR/drop_forget_ref.rs:10:12
+///   --> tests/ui/drop_forget_ref.rs:10:12
 ///    |
 /// 10 |     forget(&SomeStruct);
 ///    |            ^^^^^^^^^^^
@@ -186,7 +186,7 @@ pub fn span_lint_hir_and_then(
 ///
 /// ```text
 /// error: This `.fold` can be more succinctly expressed as `.any`
-/// --> $DIR/methods.rs:390:13
+/// --> tests/ui/methods.rs:390:13
 ///     |
 /// 390 |     let _ = (0..3).fold(false, |acc, x| acc || x > 2);
 ///     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)`