about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-08-25 16:23:23 +0200
committerUrgau <urgau@numericable.fr>2023-10-17 10:11:31 +0200
commit60e24462b68857e94454e74422cc95beb1d5b44a (patch)
tree0d8e99710f5f1c9ddcfe580a4b82feb1831e9c6b
parentab92dc37866ee9ee5a1ee95b0e997c15ab342ca7 (diff)
downloadrust-60e24462b68857e94454e74422cc95beb1d5b44a.tar.gz
rust-60e24462b68857e94454e74422cc95beb1d5b44a.zip
[RFC 3127 - Trim Paths]: Add test for -Zremap-path-scope=macro
-rw-r--r--tests/ui/errors/remap-path-prefix-macro.normal.run.stdout1
-rw-r--r--tests/ui/errors/remap-path-prefix-macro.rs12
-rw-r--r--tests/ui/errors/remap-path-prefix-macro.with-macro-scope.run.stdout1
-rw-r--r--tests/ui/errors/remap-path-prefix-macro.without-macro-scope.run.stdout1
4 files changed, 15 insertions, 0 deletions
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