diff --git a/tests/ui/track-diagnostics.rs b/tests/ui/track-diagnostics.rs index 8c96f46d5..550ccd7b3 100644 --- a/tests/ui/track-diagnostics.rs +++ b/tests/ui/track-diagnostics.rs @@ -1,6 +1,10 @@ // compile-flags: -Z track-diagnostics // error-pattern: created at +// Normalize the emitted location so this doesn't need +// updating everytime someone adds or removes a line. +// normalize-stderr-test ".rs:\d+:\d+" -> ".rs:$$LINE::$$COL" + struct A; struct B; const S: A = B; diff --git a/tests/ui/track-diagnostics.stderr b/tests/ui/track-diagnostics.stderr index 76453cfe2..5a0982ff7 100644 --- a/tests/ui/track-diagnostics.stderr +++ b/tests/ui/track-diagnostics.stderr @@ -1,9 +1,9 @@ error[E0308]: mismatched types - --> $DIR/track-diagnostics.rs:6:14 + --> $DIR/track-diagnostics.rs:$LINE::$COL | LL | const S: A = B; | ^ expected struct `A`, found struct `B` --Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:2275:31 +-Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:$LINE::$COL error: aborting due to previous error