summaryrefslogtreecommitdiffstats
path: root/tests/ui/layout
diff options
context:
space:
mode:
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`.