mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
Fix the test for transmute
This commit is contained in:
parent
6047dd35bb
commit
948754b572
@ -130,10 +130,11 @@ pub mod tests {
|
||||
|
||||
#[test]
|
||||
pub fn test_transmute() {
|
||||
use managed::raw::BoxRepr;
|
||||
unsafe {
|
||||
let x = @1;
|
||||
let x: *int = transmute(move x);
|
||||
assert *x == 1;
|
||||
let x = @100u8;
|
||||
let x: *BoxRepr = transmute(move x);
|
||||
assert (*x).data == 100;
|
||||
let _x: @int = transmute(move x);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user