From 297827fb86ae01d06fdc62184e73bfd2debdfe6d Mon Sep 17 00:00:00 2001 From: Urgau Date: Fri, 25 Aug 2023 16:36:40 +0200 Subject: [PATCH] [RFC 3127 - Trim Paths]: Add test for -Zremap-path-scope=diagnostics --- ...ath-prefix.stderr => remap-path-prefix.normal.stderr} | 2 +- tests/ui/errors/remap-path-prefix.rs | 3 +++ .../remap-path-prefix.with-diagnostic-scope.stderr | 9 +++++++++ .../remap-path-prefix.without-diagnostic-scope.stderr | 9 +++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) rename tests/ui/errors/{remap-path-prefix.stderr => remap-path-prefix.normal.stderr} (82%) create mode 100644 tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr create mode 100644 tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr diff --git a/tests/ui/errors/remap-path-prefix.stderr b/tests/ui/errors/remap-path-prefix.normal.stderr similarity index 82% rename from tests/ui/errors/remap-path-prefix.stderr rename to tests/ui/errors/remap-path-prefix.normal.stderr index 62dbd4b8881..004f10b4e43 100644 --- a/tests/ui/errors/remap-path-prefix.stderr +++ b/tests/ui/errors/remap-path-prefix.normal.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `ferris` in this scope - --> remapped/errors/remap-path-prefix.rs:16:5 + --> remapped/errors/remap-path-prefix.rs:19:5 | LL | ferris | ^^^^^^ not found in this scope diff --git a/tests/ui/errors/remap-path-prefix.rs b/tests/ui/errors/remap-path-prefix.rs index 393b8e22f1c..e3338c10fd7 100644 --- a/tests/ui/errors/remap-path-prefix.rs +++ b/tests/ui/errors/remap-path-prefix.rs @@ -1,4 +1,7 @@ +// revisions: normal with-diagnostic-scope without-diagnostic-scope // compile-flags: --remap-path-prefix={{src-base}}=remapped +// [with-diagnostic-scope]compile-flags: -Zremap-path-scope=diagnostics +// [without-diagnostic-scope]compile-flags: -Zremap-path-scope=object // no-remap-src-base: Manually remap, so the remapped path remains in .stderr file. // The remapped paths are not normalized by compiletest. diff --git a/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr b/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr new file mode 100644 index 00000000000..004f10b4e43 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix.with-diagnostic-scope.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `ferris` in this scope + --> remapped/errors/remap-path-prefix.rs:19:5 + | +LL | ferris + | ^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr b/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr new file mode 100644 index 00000000000..98fe328193c --- /dev/null +++ b/tests/ui/errors/remap-path-prefix.without-diagnostic-scope.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `ferris` in this scope + --> $DIR/remap-path-prefix.rs:19:5 + | +LL | ferris + | ^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`.