From fc661079a479f0aff6add4478c3afb8c2226b333 Mon Sep 17 00:00:00 2001 From: John Clements Date: Thu, 18 Apr 2013 17:28:22 -0700 Subject: [PATCH] fixed up syntax --- src/test/run-pass/type-sizes.rs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/test/run-pass/type-sizes.rs b/src/test/run-pass/type-sizes.rs index bc2ca20d642..134f1e4098f 100644 --- a/src/test/run-pass/type-sizes.rs +++ b/src/test/run-pass/type-sizes.rs @@ -8,9 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// xfail-test -use sys::rustrt::size_of; -extern mod std; +extern mod core; +use core::sys::size_of; + +struct t {a: u8, b: i8} +struct u {a: u8, b: i8, c: u8} +struct v {a: u8, b: i8, c: v2, d: u32} +struct v2 {u: char, v: u8} +struct w {a: int, b: ()} +struct x {a: int, b: (), c: ()} +struct y {x: int} pub fn main() { assert!((size_of::() == 1 as uint)); @@ -18,14 +25,14 @@ pub fn main() { assert!((size_of::() == 4 as uint)); assert!((size_of::() == 1 as uint)); assert!((size_of::() == 4 as uint)); - assert!((size_of::<{a: u8, b: i8}>() == 2 as uint)); - assert!((size_of::<{a: u8, b: i8, c: u8}>() == 3 as uint)); + assert!((size_of::() == 2 as uint)); + assert!((size_of::() == 3 as uint)); // Alignment causes padding before the char and the u32. - assert!(size_of::<{a: u8, b: i8, c: {u: char, v: u8}, d: u32}>() == + assert!(size_of::() == 16 as uint); assert!((size_of::() == size_of::())); - assert!((size_of::<{a: int, b: ()}>() == size_of::())); - assert!((size_of::<{a: int, b: (), c: ()}>() == size_of::())); - assert!((size_of::() == size_of::<{x: int}>())); + assert!((size_of::() == size_of::())); + assert!((size_of::() == size_of::())); + assert!((size_of::() == size_of::())); }