diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
commit | 631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch) | |
tree | a1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/ui/layout | |
parent | Adding debian version 1.69.0+dfsg1-1. (diff) | |
download | rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.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.stderr | 4 | ||||
-rw-r--r-- | tests/ui/layout/transmute-to-tail-with-err.rs | 8 | ||||
-rw-r--r-- | tests/ui/layout/transmute-to-tail-with-err.stderr | 14 |
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`. |