1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
23 let s
= S { a: 0xff_ff_ff_ffu32, b: 1, c: 0xaa_aa_aa_aa as i32 }
;
24 let transd
: [u8; 9] = mem
::transmute(s
);
25 // Don't worry about endianness, the numbers are palindromic.
27 [0xff, 0xff, 0xff, 0xff,
29 0xaa, 0xaa, 0xaa, 0xaa]);
32 let s
= S { a: 1u8, b: 2u8, c: 0b10000001_10000001 as i16}
;
33 let transd
: [u8; 4] = mem
::transmute(s
);
34 // Again, no endianness problems.
36 [1, 2, 0b10000001, 0b10000001]);