summaryrefslogtreecommitdiffstats
path: root/tests/ui/layout
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui/layout
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/layout')
-rw-r--r--tests/ui/layout/issue-84108.stderr4
-rw-r--r--tests/ui/layout/transmute-to-tail-with-err.rs8
-rw-r--r--tests/ui/layout/transmute-to-tail-with-err.stderr14
3 files changed, 24 insertions, 2 deletions
diff --git a/tests/ui/layout/issue-84108.stderr b/tests/ui/layout/issue-84108.stderr
index 36be64241..5ad450bed 100644
--- a/tests/ui/layout/issue-84108.stderr
+++ b/tests/ui/layout/issue-84108.stderr
@@ -6,7 +6,7 @@ LL | static FOO: (dyn AsRef<OsStr>, u8) = ("hello", 42);
|
help: consider importing this struct
|
-LL | use std::ffi::OsStr;
+LL + use std::ffi::OsStr;
|
error[E0412]: cannot find type `Path` in this scope
@@ -17,7 +17,7 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42);
|
help: consider importing this struct
|
-LL | use std::path::Path;
+LL + use std::path::Path;
|
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
diff --git a/tests/ui/layout/transmute-to-tail-with-err.rs b/tests/ui/layout/transmute-to-tail-with-err.rs
new file mode 100644
index 000000000..6753ce15e
--- /dev/null
+++ b/tests/ui/layout/transmute-to-tail-with-err.rs
@@ -0,0 +1,8 @@
+trait Trait<T> {}
+
+struct Bar(Box<dyn Trait<T>>);
+//~^ ERROR cannot find type `T` in this scope
+
+fn main() {
+ let x: Bar = unsafe { std::mem::transmute(()) };
+}
diff --git a/tests/ui/layout/transmute-to-tail-with-err.stderr b/tests/ui/layout/transmute-to-tail-with-err.stderr
new file mode 100644
index 000000000..97ab59c39
--- /dev/null
+++ b/tests/ui/layout/transmute-to-tail-with-err.stderr
@@ -0,0 +1,14 @@
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/transmute-to-tail-with-err.rs:3:26
+ |
+LL | struct Bar(Box<dyn Trait<T>>);
+ | ^ not found in this scope
+ |
+help: you might be missing a type parameter
+ |
+LL | struct Bar<T>(Box<dyn Trait<T>>);
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.