about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-01 12:42:16 -0800
committerbors <bors@rust-lang.org>2013-12-01 12:42:16 -0800
commit0455e4c9f8354f94eb3580e0789e9b6c8e607f21 (patch)
tree2129f406f3dc0ed5c6406ee94af9a6aff4c3d35e /src/libstd
parent9ac48785d6fb34d70729d24967840d3e31bf39fc (diff)
parentb4a1733fd23530e10545ea999557fa3b5e45c25b (diff)
downloadrust-0455e4c9f8354f94eb3580e0789e9b6c8e607f21.tar.gz
rust-0455e4c9f8354f94eb3580e0789e9b6c8e607f21.zip
auto merge of #10756 : thestinger/rust/transmute, r=alexcrichton
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/cast.rs6
-rw-r--r--src/libstd/unstable/sync.rs2
2 files changed, 1 insertions, 7 deletions
diff --git a/src/libstd/cast.rs b/src/libstd/cast.rs
index bc4579c00a0..08276082ebb 100644
--- a/src/libstd/cast.rs
+++ b/src/libstd/cast.rs
@@ -62,12 +62,6 @@ pub unsafe fn transmute<L, G>(thing: L) -> G {
 #[inline]
 pub unsafe fn transmute_mut<'a,T>(ptr: &'a T) -> &'a mut T { transmute(ptr) }
 
-/// Coerce a mutable reference to be immutable.
-#[inline]
-pub unsafe fn transmute_immut<'a,T>(ptr: &'a mut T) -> &'a T {
-    transmute(ptr)
-}
-
 /// Coerce a borrowed pointer to have an arbitrary associated region.
 #[inline]
 pub unsafe fn transmute_region<'a,'b,T>(ptr: &'a T) -> &'b T {
diff --git a/src/libstd/unstable/sync.rs b/src/libstd/unstable/sync.rs
index 02b35992f8c..420c1d69d1c 100644
--- a/src/libstd/unstable/sync.rs
+++ b/src/libstd/unstable/sync.rs
@@ -420,7 +420,7 @@ impl<T:Send> Exclusive<T> {
 
     #[inline]
     pub unsafe fn with_imm<U>(&self, f: |x: &T| -> U) -> U {
-        self.with(|x| f(cast::transmute_immut(x)))
+        self.with(|x| f(x))
     }
 
     #[inline]