Skip to content

Commit 7060377

Browse files
committed
refactor: Make -Ztrack-diagnostics emit like a note
1 parent 45b32ef commit 7060377

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

tests/ui/track-diagnostics-clippy.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ error: casting to the same type is unnecessary (`u32` -> `u32`)
33
|
44
LL | let b = a as u32;
55
| ^^^^^^^^ help: try: `a`
6-
-Ztrack-diagnostics: created at src/tools/clippy/clippy_lints/src/casts/unnecessary_cast.rs:LL:CC
76
|
7+
= note: -Ztrack-diagnostics: created at src/tools/clippy/clippy_lints/src/casts/unnecessary_cast.rs:LL:CC
88
= note: `-D clippy::unnecessary-cast` implied by `-D warnings`
99
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_cast)]`
1010

@@ -15,8 +15,8 @@ LL | let d = 42;
1515
| ----------- unnecessary `let` binding
1616
LL | d
1717
| ^
18-
-Ztrack-diagnostics: created at src/tools/clippy/clippy_lints/src/returns.rs:LL:CC
1918
|
19+
= note: -Ztrack-diagnostics: created at src/tools/clippy/clippy_lints/src/returns.rs:LL:CC
2020
= note: `-D clippy::let-and-return` implied by `-D warnings`
2121
= help: to override `-D warnings` add `#[allow(clippy::let_and_return)]`
2222
help: return the expression directly

tests/ui/track-diagnostics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ struct A;
88
struct B;
99
const S: A = B;
1010
//~^ ERROR: mismatched types
11+
//~| NOTE: created at
1112

1213
fn main() {}

tests/ui/track-diagnostics.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ error[E0308]: mismatched types
33
|
44
LL | const S: A = B;
55
| ^ expected `A`, found `B`
6-
-Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:LL:CC
6+
|
7+
= note: -Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs:LL:CC
78

89
error: aborting due to 1 previous error
910

0 commit comments

Comments
 (0)