From 22ec5f4af7b5a85ad375d672ed727571b49f3cad Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Fri, 24 Jul 2015 03:04:55 +0200 Subject: 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`. --- src/liballoc/arc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/liballoc') 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 Arc { weak: atomic::AtomicUsize::new(1), data: data, }; - Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } } + Arc { _ptr: unsafe { NonZero::new(Box::into_raw(x)) } } } } -- cgit 1.4.1-3-g733a5