rust/src/lib/unsafe.rs
2011-07-27 15:54:33 +02:00

10 lines
237 B
Rust

// Unsafe operations.
native "rust-intrinsic" mod rusti {
fn cast[T, U](src: &T) -> U;
}
// Casts the value at `src` to U. The two types must have the same length.
fn reinterpret_cast[T, U](src: &T) -> U { ret rusti::cast(src); }