Skip to content

Commit 23c8506

Browse files
committed
---
yaml --- r: 57954 b: refs/heads/incoming c: fc66107 h: refs/heads/master v: v3
1 parent 1d29454 commit 23c8506

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: bf67eb2362b7d0f37012f2d6dac604c3bbacd2c6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: c75b7630bcc45bf9f2c7f6831e46c84b0c8f024f
9+
refs/heads/incoming: fc661079a479f0aff6add4478c3afb8c2226b333
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/test/run-pass/type-sizes.rs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,31 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
12-
use sys::rustrt::size_of;
13-
extern mod std;
11+
extern mod core;
12+
use core::sys::size_of;
13+
14+
struct t {a: u8, b: i8}
15+
struct u {a: u8, b: i8, c: u8}
16+
struct v {a: u8, b: i8, c: v2, d: u32}
17+
struct v2 {u: char, v: u8}
18+
struct w {a: int, b: ()}
19+
struct x {a: int, b: (), c: ()}
20+
struct y {x: int}
1421

1522
pub fn main() {
1623
assert!((size_of::<u8>() == 1 as uint));
1724
assert!((size_of::<u32>() == 4 as uint));
1825
assert!((size_of::<char>() == 4 as uint));
1926
assert!((size_of::<i8>() == 1 as uint));
2027
assert!((size_of::<i32>() == 4 as uint));
21-
assert!((size_of::<{a: u8, b: i8}>() == 2 as uint));
22-
assert!((size_of::<{a: u8, b: i8, c: u8}>() == 3 as uint));
28+
assert!((size_of::<t>() == 2 as uint));
29+
assert!((size_of::<u>() == 3 as uint));
2330
// Alignment causes padding before the char and the u32.
2431

25-
assert!(size_of::<{a: u8, b: i8, c: {u: char, v: u8}, d: u32}>() ==
32+
assert!(size_of::<v>() ==
2633
16 as uint);
2734
assert!((size_of::<int>() == size_of::<uint>()));
28-
assert!((size_of::<{a: int, b: ()}>() == size_of::<int>()));
29-
assert!((size_of::<{a: int, b: (), c: ()}>() == size_of::<int>()));
30-
assert!((size_of::<int>() == size_of::<{x: int}>()));
35+
assert!((size_of::<w>() == size_of::<int>()));
36+
assert!((size_of::<x>() == size_of::<int>()));
37+
assert!((size_of::<int>() == size_of::<y>()));
3138
}

0 commit comments

Comments
 (0)