summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-32377.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-32377.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-32377.rs b/src/test/ui/issues/issue-32377.rs
new file mode 100644
index 000000000..555f6abd7
--- /dev/null
+++ b/src/test/ui/issues/issue-32377.rs
@@ -0,0 +1,19 @@
+// normalize-stderr-test "\d+ bits" -> "N bits"
+
+use std::mem;
+use std::marker::PhantomData;
+
+trait Foo {
+ type Error;
+}
+
+struct Bar<U: Foo> {
+ stream: PhantomData<U::Error>,
+}
+
+fn foo<U: Foo>(x: [usize; 2]) -> Bar<U> {
+ unsafe { mem::transmute(x) }
+ //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types
+}
+
+fn main() {}