Skip to content

Commit d1921fb

Browse files
committed
fixed this test case too
1 parent 3931ce4 commit d1921fb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/test/run-pass/tag-align-u64.rs

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

11-
// xfail-test
1211

13-
tag a_tag {
14-
a_tag(u64);
12+
enum a_tag {
13+
a_tag(u64)
1514
}
1615

17-
type t_rec = {
16+
struct t_rec {
1817
c8: u8,
1918
t: a_tag
20-
};
19+
}
2120

2221
fn mk_rec() -> t_rec {
23-
return { c8:0u8, t:a_tag(0u64) };
22+
return t_rec { c8:0u8, t:a_tag(0u64) };
2423
}
2524

26-
fn is_8_byte_aligned(&&u: a_tag) -> bool {
25+
fn is_8_byte_aligned(u: &a_tag) -> bool {
2726
let p = ptr::to_unsafe_ptr(u) as u64;
2827
return (p & 7u64) == 0u64;
2928
}
3029

3130
pub fn main() {
3231
let x = mk_rec();
33-
assert!(is_8_byte_aligned(x.t));
32+
assert!(is_8_byte_aligned(&x.t));
3433
}

0 commit comments

Comments
 (0)