File tree 3 files changed +2
-8
lines changed
3 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,7 @@ impl<T:Freeze + Send> RWArc<T> {
485
485
// Whatever region the input reference had, it will be safe to use
486
486
// the same region for the output reference. (The only 'unsafe' part
487
487
// of this cast is removing the mutability.)
488
- let new_data = cast :: transmute_immut ( data) ;
488
+ let new_data = data;
489
489
// Downgrade ensured the token belonged to us. Just a sanity check.
490
490
assert ! ( borrow:: ref_eq( & ( * state) . data, new_data) ) ;
491
491
// Produce new token
Original file line number Diff line number Diff line change @@ -62,12 +62,6 @@ pub unsafe fn transmute<L, G>(thing: L) -> G {
62
62
#[ inline]
63
63
pub unsafe fn transmute_mut < ' a , T > ( ptr : & ' a T ) -> & ' a mut T { transmute ( ptr) }
64
64
65
- /// Coerce a mutable reference to be immutable.
66
- #[ inline]
67
- pub unsafe fn transmute_immut < ' a , T > ( ptr : & ' a mut T ) -> & ' a T {
68
- transmute ( ptr)
69
- }
70
-
71
65
/// Coerce a borrowed pointer to have an arbitrary associated region.
72
66
#[ inline]
73
67
pub unsafe fn transmute_region < ' a , ' b , T > ( ptr : & ' a T ) -> & ' b T {
Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ impl<T:Send> Exclusive<T> {
420
420
421
421
#[ inline]
422
422
pub unsafe fn with_imm < U > ( & self , f: |x: & T | -> U ) -> U {
423
- self . with ( |x| f ( cast :: transmute_immut ( x ) ) )
423
+ self . with ( |x| f ( x ) )
424
424
}
425
425
426
426
#[ inline]
You can’t perform that action at this time.
0 commit comments