From 60e24462b68857e94454e74422cc95beb1d5b44a Mon Sep 17 00:00:00 2001 From: Urgau Date: Fri, 25 Aug 2023 16:23:23 +0200 Subject: [PATCH] [RFC 3127 - Trim Paths]: Add test for -Zremap-path-scope=macro --- .../errors/remap-path-prefix-macro.normal.run.stdout | 1 + tests/ui/errors/remap-path-prefix-macro.rs | 12 ++++++++++++ ...map-path-prefix-macro.with-macro-scope.run.stdout | 1 + ...-path-prefix-macro.without-macro-scope.run.stdout | 1 + 4 files changed, 15 insertions(+) create mode 100644 tests/ui/errors/remap-path-prefix-macro.normal.run.stdout create mode 100644 tests/ui/errors/remap-path-prefix-macro.rs create mode 100644 tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout create mode 100644 tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout diff --git a/tests/ui/errors/remap-path-prefix-macro.normal.run.stdout b/tests/ui/errors/remap-path-prefix-macro.normal.run.stdout new file mode 100644 index 00000000000..3bbdcbb8655 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.normal.run.stdout @@ -0,0 +1 @@ +remapped/errors/remap-path-prefix-macro.rs diff --git a/tests/ui/errors/remap-path-prefix-macro.rs b/tests/ui/errors/remap-path-prefix-macro.rs new file mode 100644 index 00000000000..0ba706b0a8f --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.rs @@ -0,0 +1,12 @@ +// run-pass +// check-run-results + +// revisions: normal with-macro-scope without-macro-scope +// compile-flags: --remap-path-prefix={{src-base}}=remapped +// [with-macro-scope]compile-flags: -Zremap-path-scope=macro,diagnostics +// [without-macro-scope]compile-flags: -Zremap-path-scope=diagnostics +// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file. + +fn main() { + println!("{}", file!()); +} diff --git a/tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout b/tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout new file mode 100644 index 00000000000..3bbdcbb8655 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout @@ -0,0 +1 @@ +remapped/errors/remap-path-prefix-macro.rs diff --git a/tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout b/tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout new file mode 100644 index 00000000000..642823fec86 --- /dev/null +++ b/tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout @@ -0,0 +1 @@ +$DIR/remap-path-prefix-macro.rs