diff --git a/src/lib/unsafe.rs b/src/lib/unsafe.rs new file mode 100644 index 00000000000..11068b87e48 --- /dev/null +++ b/src/lib/unsafe.rs @@ -0,0 +1,9 @@ +// Unsafe operations. + +native "rust-intrinsic" mod rusti { + fn cast[T,U](&T src) -> U; +} + +// Casts the value at `src` to U. The two types must have the same length. +fn reinterpret_cast[T,U](&T src) -> U { ret rusti::cast(src); } +