Skip to content

Commit 91dcc1d

Browse files
committed
stdlib: Add missing unsafe.rs. Puts out burning tinderbox.
1 parent 7efb942 commit 91dcc1d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib/unsafe.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Unsafe operations.
2+
3+
native "rust-intrinsic" mod rusti {
4+
fn cast[T,U](&T src) -> U;
5+
}
6+
7+
// Casts the value at `src` to U. The two types must have the same length.
8+
fn reinterpret_cast[T,U](&T src) -> U { ret rusti::cast(src); }
9+

0 commit comments

Comments
 (0)