From 1b17eefa4aff87ae393c6d5aff7e90ff7c3c3185 Mon Sep 17 00:00:00 2001 From: Jonathan Reem Date: Sat, 22 Nov 2014 16:06:21 -0800 Subject: Any: use plain transmute instead of transmute_copy for downcasting. transmute_copy is no longer needed and is just slow. --- src/libcore/any.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 5511266b4cd..ebd6fab34e9 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -71,7 +71,7 @@ #![stable] -use mem::{transmute, transmute_copy}; +use mem::{transmute}; use option::{Option, Some, None}; use raw::TraitObject; use intrinsics::TypeId; @@ -134,7 +134,7 @@ impl<'a> AnyRefExt<'a> for &'a Any { if self.is::() { unsafe { // Get the raw representation of the trait object - let to: TraitObject = transmute_copy(&self); + let to: TraitObject = transmute(self); // Extract the data pointer Some(transmute(to.data)) @@ -162,7 +162,7 @@ impl<'a> AnyMutRefExt<'a> for &'a mut Any { if self.is::() { unsafe { // Get the raw representation of the trait object - let to: TraitObject = transmute_copy(&self); + let to: TraitObject = transmute(self); // Extract the data pointer Some(transmute(to.data)) -- cgit 1.4.1-3-g733a5