diff options
Diffstat (limited to 'tests/ui/layout/transmute-to-tail-with-err.rs')
-rw-r--r-- | tests/ui/layout/transmute-to-tail-with-err.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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(()) }; +} |