1 // run-pass
2 
3 #![allow(dead_code)]
4 
5 use std::mem;
6 
7 enum E<T> { Thing(isize, T), Nothing((), ((), ()), [i8; 0]) }
8 struct S<T>(isize, T);
9 
10 // These are macros so we get useful assert messages.
11 
12 macro_rules! check_option {
13     ($T:ty) => {
14         assert_eq!(mem::size_of::<Option<$T>>(), mem::size_of::<$T>());
15     }
16 }
17 
18 macro_rules! check_fancy {
19     ($T:ty) => {
20         assert_eq!(mem::size_of::<E<$T>>(), mem::size_of::<S<$T>>());
21     }
22 }
23 
24 macro_rules! check_type {
25     ($T:ty) => {{
26         check_option!($T);
27         check_fancy!($T);
28     }}
29 }
30 
main()31 pub fn main() {
32     check_type!(&'static isize);
33     check_type!(Box<isize>);
34     check_type!(extern "C" fn());
35 }
36