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