mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
with syntax fixes, this test case now appears to pass
This commit is contained in:
parent
cc4e0186ac
commit
d6bb587c12
@ -8,27 +8,25 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// xfail-test
|
||||
|
||||
tag a_tag<A> {
|
||||
a_tag(A);
|
||||
enum a_tag<A> {
|
||||
a_tag(A)
|
||||
}
|
||||
|
||||
type t_rec = {
|
||||
struct t_rec {
|
||||
c8: u8,
|
||||
t: a_tag<u64>
|
||||
};
|
||||
|
||||
fn mk_rec() -> t_rec {
|
||||
return { c8:0u8, t:a_tag(0u64) };
|
||||
}
|
||||
|
||||
fn is_8_byte_aligned(&&u: a_tag<u64>) -> bool {
|
||||
fn mk_rec() -> t_rec {
|
||||
return t_rec { c8:0u8, t:a_tag(0u64) };
|
||||
}
|
||||
|
||||
fn is_8_byte_aligned(u: &a_tag<u64>) -> bool {
|
||||
let p = ptr::to_unsafe_ptr(u) as uint;
|
||||
return (p & 7u) == 0u;
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let x = mk_rec();
|
||||
assert!(is_8_byte_aligned(x.t));
|
||||
assert!(is_8_byte_aligned(&x.t));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user