about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2015-07-24 03:04:55 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2015-08-09 22:05:22 +0200
commit22ec5f4af7b5a85ad375d672ed727571b49f3cad (patch)
treeeea29f1286398aaaa9d55f23163ddcc49b033eeb /src/liballoc
parentfebdc3b201bcce1546c88e3be1b956d3f90d3059 (diff)
downloadrust-22ec5f4af7b5a85ad375d672ed727571b49f3cad.tar.gz
rust-22ec5f4af7b5a85ad375d672ed727571b49f3cad.zip
Replace many uses of `mem::transmute` with more specific functions
The replacements are functions that usually use a single `mem::transmute` in
their body and restrict input and output via more concrete types than `T` and
`U`. Worth noting are the `transmute` functions for slices and the `from_utf8*`
family for mutable slices. Additionally, `mem::transmute` was often used for
casting raw pointers, when you can already cast raw pointers just fine with
`as`.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 1e592397014..56c7324090e 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -193,7 +193,7 @@ impl<T> Arc<T> {
             weak: atomic::AtomicUsize::new(1),
             data: data,
         };
-        Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } }
+        Arc { _ptr: unsafe { NonZero::new(Box::into_raw(x)) } }
     }
 }