summaryrefslogtreecommitdiffstats
path: root/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
new file mode 100644
index 000000000..86fc8bd6b
--- /dev/null
+++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
@@ -0,0 +1,22 @@
+// An unknown destination type should be gracefully handled.
+
+#![crate_type = "lib"]
+#![feature(transmutability)]
+#![allow(dead_code, incomplete_features, non_camel_case_types)]
+
+mod assert {
+ use std::mem::BikeshedIntrinsicFrom;
+ pub struct Context;
+
+ pub fn is_transmutable<Src, Dst, Context>()
+ where
+ Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
+ {}
+}
+
+fn should_gracefully_handle_unknown_dst_field() {
+ struct Context;
+ #[repr(C)] struct Src;
+ #[repr(C)] struct Dst(Missing); //~ cannot find type
+ assert::is_transmutable::<Src, Dst, Context>();
+}