Skip to content

Commit

Permalink
Remove $DIR replacement in docs sampling stderr files
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Feb 17, 2024
1 parent 1d107ab commit 740d89e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions book/src/development/emitting_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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);
| ^^^^^^^^^^^
Expand All @@ -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;
| ^^^^^^^^^^^^
Expand All @@ -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)`
Expand Down
6 changes: 3 additions & 3 deletions book/src/development/writing_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
| ^^^
Expand Down
10 changes: 5 additions & 5 deletions clippy_utils/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/// | ^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -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;
/// | ^^^^^^^^^^^^
Expand Down Expand Up @@ -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);
/// | ^^^^^^^^^^^
Expand Down Expand Up @@ -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)`
Expand Down

0 comments on commit 740d89e

Please sign in to comment.