3 // Test that we can handle newtypes wrapping extern types
5 #![feature(extern_types, const_transmute)]
7 use std::marker::PhantomData;
12 unsafe impl Sync for ExternType {}
13 static MAGIC_FFI_STATIC: u8 = 42;
16 pub struct Wrapper(ExternType);
17 pub static MAGIC_FFI_REF: &'static Wrapper = unsafe {
18 std::mem::transmute(&MAGIC_FFI_STATIC)
22 pub struct Wrapper2(PhantomData<Vec<i32>>, ExternType);
23 pub static MAGIC_FFI_REF2: &'static Wrapper2 = unsafe {
24 std::mem::transmute(&MAGIC_FFI_STATIC)