From 91dcc1d054cdf86582bad6b6d343761041a1f5de Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sun, 10 Jul 2011 01:32:35 -0700 Subject: [PATCH] stdlib: Add missing unsafe.rs. Puts out burning tinderbox. --- src/lib/unsafe.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/lib/unsafe.rs 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); } +