]>
Commit | Line | Data |
---|---|---|
064997fb FG |
1 | //! Transmutations involving references are not yet supported. |
2 | ||
3 | #![crate_type = "lib"] | |
4 | #![feature(transmutability)] | |
5 | #![allow(dead_code, incomplete_features, non_camel_case_types)] | |
6 | ||
7 | mod assert { | |
f2b60f7d | 8 | use std::mem::{Assume, BikeshedIntrinsicFrom}; |
064997fb FG |
9 | pub struct Context; |
10 | ||
11 | pub fn is_maybe_transmutable<Src, Dst>() | |
12 | where | |
f2b60f7d FG |
13 | Dst: BikeshedIntrinsicFrom<Src, Context, { |
14 | Assume { | |
15 | alignment: true, | |
16 | lifetimes: true, | |
17 | safety: true, | |
18 | validity: true, | |
19 | } | |
20 | }> | |
064997fb FG |
21 | {} |
22 | } | |
23 | ||
24 | fn not_yet_implemented() { | |
25 | #[repr(C)] struct Unit; | |
26 | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); //~ ERROR cannot be safely transmuted | |
27 | } |