diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-2895.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-2895.rs b/src/test/ui/issues/issue-2895.rs new file mode 100644 index 000000000..d8c08996b --- /dev/null +++ b/src/test/ui/issues/issue-2895.rs @@ -0,0 +1,28 @@ +// run-pass +#![allow(dead_code)] + +use std::mem; + +struct Cat { + x: isize +} + +struct Kitty { + x: isize, +} + +impl Drop for Kitty { + fn drop(&mut self) {} +} + +#[cfg(target_pointer_width = "64")] +pub fn main() { + assert_eq!(mem::size_of::<Cat>(), 8 as usize); + assert_eq!(mem::size_of::<Kitty>(), 8 as usize); +} + +#[cfg(target_pointer_width = "32")] +pub fn main() { + assert_eq!(mem::size_of::<Cat>(), 4 as usize); + assert_eq!(mem::size_of::<Kitty>(), 4 as usize); +} |