summaryrefslogtreecommitdiffstats
path: root/tests/ui/errors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/errors
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/errors/auxiliary/remapped_dep.rs4
-rw-r--r--tests/ui/errors/issue-104621-extern-bad-file.rs (renamed from src/test/ui/errors/issue-104621-extern-bad-file.rs)0
-rw-r--r--tests/ui/errors/issue-104621-extern-bad-file.stderr (renamed from src/test/ui/errors/issue-104621-extern-bad-file.stderr)0
-rw-r--r--tests/ui/errors/issue-104621-extern-not-file.rs (renamed from src/test/ui/errors/issue-104621-extern-not-file.rs)0
-rw-r--r--tests/ui/errors/issue-104621-extern-not-file.stderr (renamed from src/test/ui/errors/issue-104621-extern-not-file.stderr)0
-rw-r--r--tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs (renamed from src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.rs)0
-rw-r--r--tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr (renamed from src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr)0
-rw-r--r--tests/ui/errors/issue-99572-impl-trait-on-pointer.rs (renamed from src/test/ui/errors/issue-99572-impl-trait-on-pointer.rs)0
-rw-r--r--tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr (renamed from src/test/ui/errors/issue-99572-impl-trait-on-pointer.stderr)0
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.local-self.stderr14
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr14
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.rs17
-rw-r--r--tests/ui/errors/remap-path-prefix.rs17
-rw-r--r--tests/ui/errors/remap-path-prefix.stderr (renamed from src/test/ui/remap-path-prefix.stderr)2
14 files changed, 67 insertions, 1 deletions
diff --git a/tests/ui/errors/auxiliary/remapped_dep.rs b/tests/ui/errors/auxiliary/remapped_dep.rs
new file mode 100644
index 000000000..f9bb7bf89
--- /dev/null
+++ b/tests/ui/errors/auxiliary/remapped_dep.rs
@@ -0,0 +1,4 @@
+// compile-flags: --remap-path-prefix={{src-base}}/errors/auxiliary=remapped-aux
+// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file.
+
+pub struct SomeStruct {} // This line should be show as part of the error.
diff --git a/src/test/ui/errors/issue-104621-extern-bad-file.rs b/tests/ui/errors/issue-104621-extern-bad-file.rs
index 3f13d6052..3f13d6052 100644
--- a/src/test/ui/errors/issue-104621-extern-bad-file.rs
+++ b/tests/ui/errors/issue-104621-extern-bad-file.rs
diff --git a/src/test/ui/errors/issue-104621-extern-bad-file.stderr b/tests/ui/errors/issue-104621-extern-bad-file.stderr
index b8500ad0e..b8500ad0e 100644
--- a/src/test/ui/errors/issue-104621-extern-bad-file.stderr
+++ b/tests/ui/errors/issue-104621-extern-bad-file.stderr
diff --git a/src/test/ui/errors/issue-104621-extern-not-file.rs b/tests/ui/errors/issue-104621-extern-not-file.rs
index 899e45a30..899e45a30 100644
--- a/src/test/ui/errors/issue-104621-extern-not-file.rs
+++ b/tests/ui/errors/issue-104621-extern-not-file.rs
diff --git a/src/test/ui/errors/issue-104621-extern-not-file.stderr b/tests/ui/errors/issue-104621-extern-not-file.stderr
index 5aaf97413..5aaf97413 100644
--- a/src/test/ui/errors/issue-104621-extern-not-file.stderr
+++ b/tests/ui/errors/issue-104621-extern-not-file.stderr
diff --git a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.rs b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs
index a1c7af128..a1c7af128 100644
--- a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.rs
+++ b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.rs
diff --git a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
index 08eb8cfac..08eb8cfac 100644
--- a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
+++ b/tests/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
diff --git a/src/test/ui/errors/issue-99572-impl-trait-on-pointer.rs b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs
index 272c6bd3f..272c6bd3f 100644
--- a/src/test/ui/errors/issue-99572-impl-trait-on-pointer.rs
+++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs
diff --git a/src/test/ui/errors/issue-99572-impl-trait-on-pointer.stderr b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr
index 78d7a47de..78d7a47de 100644
--- a/src/test/ui/errors/issue-99572-impl-trait-on-pointer.stderr
+++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr
diff --git a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
new file mode 100644
index 000000000..51e3b776c
--- /dev/null
+++ b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
@@ -0,0 +1,14 @@
+error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
+ --> $DIR/remap-path-prefix-reverse.rs:16:13
+ |
+LL | let _ = remapped_dep::SomeStruct; // ~ERROR E0423
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
+ |
+ ::: remapped-aux/remapped_dep.rs:4:1
+ |
+LL | pub struct SomeStruct {} // This line should be show as part of the error.
+ | --------------------- `remapped_dep::SomeStruct` defined here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0423`.
diff --git a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
new file mode 100644
index 000000000..51e3b776c
--- /dev/null
+++ b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
@@ -0,0 +1,14 @@
+error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
+ --> $DIR/remap-path-prefix-reverse.rs:16:13
+ |
+LL | let _ = remapped_dep::SomeStruct; // ~ERROR E0423
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
+ |
+ ::: remapped-aux/remapped_dep.rs:4:1
+ |
+LL | pub struct SomeStruct {} // This line should be show as part of the error.
+ | --------------------- `remapped_dep::SomeStruct` defined here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0423`.
diff --git a/tests/ui/errors/remap-path-prefix-reverse.rs b/tests/ui/errors/remap-path-prefix-reverse.rs
new file mode 100644
index 000000000..71c80063c
--- /dev/null
+++ b/tests/ui/errors/remap-path-prefix-reverse.rs
@@ -0,0 +1,17 @@
+// aux-build:remapped_dep.rs
+// compile-flags: --remap-path-prefix={{src-base}}/errors/auxiliary=remapped-aux
+
+// revisions: local-self remapped-self
+// [local-self] no-remap-src-base: The hack should work regardless of remapping.
+// [remapped-self] remap-src-base
+
+// Verify that the expected source code is shown.
+// error-pattern: pub struct SomeStruct {} // This line should be show
+
+extern crate remapped_dep;
+
+fn main() {
+ // The actual error is irrelevant. The important part it that is should show
+ // a snippet of the dependency's source.
+ let _ = remapped_dep::SomeStruct; // ~ERROR E0423
+}
diff --git a/tests/ui/errors/remap-path-prefix.rs b/tests/ui/errors/remap-path-prefix.rs
new file mode 100644
index 000000000..393b8e22f
--- /dev/null
+++ b/tests/ui/errors/remap-path-prefix.rs
@@ -0,0 +1,17 @@
+// compile-flags: --remap-path-prefix={{src-base}}=remapped
+// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file.
+
+// The remapped paths are not normalized by compiletest.
+// normalize-stderr-test: "\\(errors)" -> "/$1"
+
+// The remapped paths aren't recognized by compiletest, so we
+// cannot use line-specific patterns.
+// error-pattern: E0425
+
+fn main() {
+ // We cannot actually put an ERROR marker here because
+ // the file name in the error message is not what the
+ // test framework expects (since the filename gets remapped).
+ // We still test the expected error in the stderr file.
+ ferris
+}
diff --git a/src/test/ui/remap-path-prefix.stderr b/tests/ui/errors/remap-path-prefix.stderr
index ad6a35d12..62dbd4b88 100644
--- a/src/test/ui/remap-path-prefix.stderr
+++ b/tests/ui/errors/remap-path-prefix.stderr
@@ -1,5 +1,5 @@
error[E0425]: cannot find value `ferris` in this scope
- --> remapped/remap-path-prefix.rs:8:5
+ --> remapped/errors/remap-path-prefix.rs:16:5
|
LL | ferris
| ^^^^^^ not found in this scope