1 #![feature(transparent_unions)]
2 #![feature(ptr_internals)]
3 #![deny(improper_ctypes)]
14 enum ReprC { A, B, C }
20 enum Isize { A, B, C }
23 struct TransparentStruct<T>(T, std::marker::PhantomData<Z>);
26 enum TransparentEnum<T> {
27 Variant(T, std::marker::PhantomData<Z>),
31 union TransparentUnion<T: Copy> {
39 fn uf(x: U); //~ ERROR `extern` block uses type `U`
40 fn bf(x: B); //~ ERROR `extern` block uses type `B`
41 fn tf(x: T); //~ ERROR `extern` block uses type `T`
44 fn repr_isize(x: Isize);
45 fn option_ref(x: Option<&'static u8>);
46 fn option_fn(x: Option<extern "C" fn()>);
47 fn nonnull(x: Option<std::ptr::NonNull<u8>>);
48 fn unique(x: Option<std::ptr::Unique<u8>>);
49 //~^ ERROR `extern` block uses type `std::option::Option<std::ptr::Unique<u8>>`
50 fn nonzero_u8(x: Option<num::NonZeroU8>);
51 fn nonzero_u16(x: Option<num::NonZeroU16>);
52 fn nonzero_u32(x: Option<num::NonZeroU32>);
53 fn nonzero_u64(x: Option<num::NonZeroU64>);
54 fn nonzero_u128(x: Option<num::NonZeroU128>);
55 //~^ ERROR `extern` block uses type `u128`
56 fn nonzero_usize(x: Option<num::NonZeroUsize>);
57 fn nonzero_i8(x: Option<num::NonZeroI8>);
58 fn nonzero_i16(x: Option<num::NonZeroI16>);
59 fn nonzero_i32(x: Option<num::NonZeroI32>);
60 fn nonzero_i64(x: Option<num::NonZeroI64>);
61 fn nonzero_i128(x: Option<num::NonZeroI128>);
62 //~^ ERROR `extern` block uses type `i128`
63 fn nonzero_isize(x: Option<num::NonZeroIsize>);
64 fn transparent_struct(x: Option<TransparentStruct<num::NonZeroU8>>);
65 fn transparent_enum(x: Option<TransparentEnum<num::NonZeroU8>>);
66 fn transparent_union(x: Option<TransparentUnion<num::NonZeroU8>>);
67 //~^ ERROR `extern` block uses type
68 fn repr_rust(x: Option<Rust<num::NonZeroU8>>); //~ ERROR `extern` block uses type
69 fn no_result(x: Result<(), num::NonZeroI32>); //~ ERROR `extern` block uses type