about summary refs log tree commit diff
path: root/src/test/stdtest/unsafe.rs
blob: b8197cf4c238c11c937a7f65e2933a09a1727035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import core::*;

import unsafe;

#[test]
fn reinterpret_cast() unsafe {
    assert unsafe::reinterpret_cast(1) == 1u;
}

#[test]
#[should_fail]
#[ignore(cfg(target_os = "win32"))]
fn reinterpret_cast_wrong_size() unsafe {
    let _i: uint = unsafe::reinterpret_cast(0u8);
}