diff options
Diffstat (limited to 'src/libstd/cast.rs')
| -rw-r--r-- | src/libstd/cast.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/cast.rs b/src/libstd/cast.rs index 50b5b2fcd29..86eec80ae6f 100644 --- a/src/libstd/cast.rs +++ b/src/libstd/cast.rs @@ -36,6 +36,14 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U { } /** + * Forces a copy of a value, even if that value is considered noncopyable. + */ +#[inline] +pub unsafe fn unsafe_copy<T>(thing: &T) -> T { + transmute_copy(thing) +} + +/** * Move a thing into the void * * The forget function will take ownership of the provided value but neglect |
