about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorJonathan Reem <jonathan.reem@gmail.com>2014-11-22 16:06:21 -0800
committerJonathan Reem <jonathan.reem@gmail.com>2014-11-22 16:06:21 -0800
commit1b17eefa4aff87ae393c6d5aff7e90ff7c3c3185 (patch)
treeb7a247b8ed039d5c83095b8b5f16106a7cb3e7a1 /src/libcore
parent0d0a29061443852cae070b27d51de7cc69bbf293 (diff)
Any: use plain transmute instead of transmute_copy for downcasting.
transmute_copy is no longer needed and is just slow.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/any.rs6
1 files changed, 3 insertions, 3 deletions
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::<T>() {
             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::<T>() {
             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))