diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-28625.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-28625.rs b/src/test/ui/issues/issue-28625.rs new file mode 100644 index 000000000..15a6a63d5 --- /dev/null +++ b/src/test/ui/issues/issue-28625.rs @@ -0,0 +1,22 @@ +// normalize-stderr-test "\d+ bits" -> "N bits" + +trait Bar { + type Bar; +} + +struct ArrayPeano<T: Bar> { + data: T::Bar, +} + +fn foo<T>(a: &ArrayPeano<T>) -> &[T] where T: Bar { + unsafe { std::mem::transmute(a) } //~ ERROR cannot transmute between types of different sizes +} + +impl Bar for () { + type Bar = (); +} + +fn main() { + let x: ArrayPeano<()> = ArrayPeano { data: () }; + foo(&x); +} |