diff options
Diffstat (limited to 'src/test/ui/structs-enums/enum-alignment.rs')
-rw-r--r-- | src/test/ui/structs-enums/enum-alignment.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/test/ui/structs-enums/enum-alignment.rs b/src/test/ui/structs-enums/enum-alignment.rs deleted file mode 100644 index 108dfe2e6..000000000 --- a/src/test/ui/structs-enums/enum-alignment.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -#![allow(dead_code)] -#![allow(deprecated)] - -use std::mem; - -fn addr_of<T>(ptr: &T) -> usize { - ptr as *const T as usize -} - -fn is_aligned<T>(ptr: &T) -> bool { - unsafe { - let addr: usize = mem::transmute(ptr); - (addr % mem::min_align_of::<T>()) == 0 - } -} - -pub fn main() { - let x = Some(0u64); - match x { - None => panic!(), - Some(ref y) => assert!(is_aligned(y)) - } -} |