Skip to content

Commit 740d89e

Browse files
committed
Remove $DIR replacement in docs sampling stderr files
1 parent 1d107ab commit 740d89e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

book/src/development/emitting_lints.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The output looks something like this (from the example earlier):
8282

8383
```text
8484
error: an inclusive range would be more readable
85-
--> $DIR/range_plus_minus_one.rs:37:14
85+
--> tests/ui/range_plus_minus_one.rs:37:14
8686
|
8787
LL | for _ in 1..1 + 1 {}
8888
| ^^^^^^^^ help: use: `1..=1`
@@ -135,14 +135,14 @@ Examples:
135135

136136
```text
137137
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
138-
--> $DIR/drop_forget_ref.rs:10:5
138+
--> tests/ui/drop_forget_ref.rs:10:5
139139
|
140140
10 | forget(&SomeStruct);
141141
| ^^^^^^^^^^^^^^^^^^^
142142
|
143143
= note: `-D clippy::forget-ref` implied by `-D warnings`
144144
note: argument has type &SomeStruct
145-
--> $DIR/drop_forget_ref.rs:10:12
145+
--> tests/ui/drop_forget_ref.rs:10:12
146146
|
147147
10 | forget(&SomeStruct);
148148
| ^^^^^^^^^^^
@@ -158,7 +158,7 @@ Example:
158158

159159
```text
160160
error: constant division of 0.0 with 0.0 will always result in NaN
161-
--> $DIR/zero_div_zero.rs:6:25
161+
--> tests/ui/zero_div_zero.rs:6:25
162162
|
163163
6 | let other_f64_nan = 0.0f64 / 0.0;
164164
| ^^^^^^^^^^^^
@@ -176,7 +176,7 @@ Example:
176176

177177
```text
178178
error: This `.fold` can be more succinctly expressed as `.any`
179-
--> $DIR/methods.rs:390:13
179+
--> tests/ui/methods.rs:390:13
180180
|
181181
390 | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
182182
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)`

book/src/development/writing_tests.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,19 @@ failures:
9797
---- compile_test stdout ----
9898
normalized stderr:
9999
error: function called "foo"
100-
--> $DIR/foo_functions.rs:6:12
100+
--> tests/ui/foo_functions.rs:6:12
101101
|
102102
LL | pub fn foo(&self) {}
103103
| ^^^
104104
|
105105
= note: `-D clippy::foo-functions` implied by `-D warnings`
106106
error: function called "foo"
107-
--> $DIR/foo_functions.rs:13:8
107+
--> tests/ui/foo_functions.rs:13:8
108108
|
109109
LL | fn foo(&self) {}
110110
| ^^^
111111
error: function called "foo"
112-
--> $DIR/foo_functions.rs:19:4
112+
--> tests/ui/foo_functions.rs:19:4
113113
|
114114
LL | fn foo() {}
115115
| ^^^

clippy_utils/src/diagnostics.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn docs_link(diag: &mut Diagnostic, lint: &'static Lint) {
4040
///
4141
/// ```ignore
4242
/// error: usage of mem::forget on Drop type
43-
/// --> $DIR/mem_forget.rs:17:5
43+
/// --> tests/ui/mem_forget.rs:17:5
4444
/// |
4545
/// 17 | std::mem::forget(seven);
4646
/// | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -65,7 +65,7 @@ pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<Mult
6565
///
6666
/// ```text
6767
/// error: constant division of 0.0 with 0.0 will always result in NaN
68-
/// --> $DIR/zero_div_zero.rs:6:25
68+
/// --> tests/ui/zero_div_zero.rs:6:25
6969
/// |
7070
/// 6 | let other_f64_nan = 0.0f64 / 0.0;
7171
/// | ^^^^^^^^^^^^
@@ -103,14 +103,14 @@ pub fn span_lint_and_help<T: LintContext>(
103103
///
104104
/// ```text
105105
/// error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
106-
/// --> $DIR/drop_forget_ref.rs:10:5
106+
/// --> tests/ui/drop_forget_ref.rs:10:5
107107
/// |
108108
/// 10 | forget(&SomeStruct);
109109
/// | ^^^^^^^^^^^^^^^^^^^
110110
/// |
111111
/// = note: `-D clippy::forget-ref` implied by `-D warnings`
112112
/// note: argument has type &SomeStruct
113-
/// --> $DIR/drop_forget_ref.rs:10:12
113+
/// --> tests/ui/drop_forget_ref.rs:10:12
114114
/// |
115115
/// 10 | forget(&SomeStruct);
116116
/// | ^^^^^^^^^^^
@@ -186,7 +186,7 @@ pub fn span_lint_hir_and_then(
186186
///
187187
/// ```text
188188
/// error: This `.fold` can be more succinctly expressed as `.any`
189-
/// --> $DIR/methods.rs:390:13
189+
/// --> tests/ui/methods.rs:390:13
190190
/// |
191191
/// 390 | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
192192
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)`

0 commit comments

Comments
 (0)