about summary refs log tree commit diff
path: root/tests/ui/transmutability/arrays/issue-103783-array-length.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/transmutability/arrays/issue-103783-array-length.rs')
-rw-r--r--tests/ui/transmutability/arrays/issue-103783-array-length.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/transmutability/arrays/issue-103783-array-length.rs b/tests/ui/transmutability/arrays/issue-103783-array-length.rs
new file mode 100644
index 00000000000..cb36e539ed1
--- /dev/null
+++ b/tests/ui/transmutability/arrays/issue-103783-array-length.rs
@@ -0,0 +1,24 @@
+#![crate_type = "lib"]
+#![feature(transmutability)]
+#![allow(dead_code)]
+
+mod assert {
+    use std::mem::{Assume, BikeshedIntrinsicFrom};
+    pub struct Context;
+
+    pub fn is_maybe_transmutable<Src, Dst>()
+    where
+        Dst: BikeshedIntrinsicFrom<
+            Src,
+            Context,
+            { Assume { alignment: true, lifetimes: true, safety: true, validity: true } },
+        >,
+    {
+    }
+}
+
+fn test() {
+    type NaughtyLenArray = [u32; 3.14159]; //~ ERROR mismatched types
+    type JustUnit = ();
+    assert::is_maybe_transmutable::<JustUnit, NaughtyLenArray>();
+}