File tree Expand file tree Collapse file tree 5 files changed +10
-17
lines changed Expand file tree Collapse file tree 5 files changed +10
-17
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 4cc723dc22e5ebcbac4dc431a82ea75bc9ae6017
2
+ refs/heads/master: 9e8d5aa29e40066b9c247ef252b58c2092ecdfae
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5
5
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff
Original file line number Diff line number Diff line change @@ -167,13 +167,12 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
167
167
// is necessary in order to properly do cleanup if a failure occurs
168
168
// during an initializer.
169
169
#[ inline]
170
- unsafe fn bitpack_tydesc_ptr ( p : * TyDesc , is_done : bool ) -> uint {
171
- let p_bits: uint = transmute ( p) ;
172
- p_bits | ( is_done as uint )
170
+ fn bitpack_tydesc_ptr ( p : * TyDesc , is_done : bool ) -> uint {
171
+ p as uint | ( is_done as uint )
173
172
}
174
173
#[ inline]
175
- unsafe fn un_bitpack_tydesc_ptr ( p : uint ) -> ( * TyDesc , bool ) {
176
- ( transmute ( p & !1 ) , p & 1 == 1 )
174
+ fn un_bitpack_tydesc_ptr ( p : uint ) -> ( * TyDesc , bool ) {
175
+ ( ( p & !1 ) as * TyDesc , p & 1 == 1 )
177
176
}
178
177
179
178
impl Arena {
Original file line number Diff line number Diff line change @@ -161,9 +161,7 @@ pub mod reader {
161
161
] ;
162
162
163
163
unsafe {
164
- let ( ptr, _) : ( * u8 , uint ) = transmute ( data) ;
165
- let ptr = ptr. offset ( start as int ) ;
166
- let ptr: * i32 = transmute ( ptr) ;
164
+ let ptr = data. as_ptr ( ) . offset ( start as int ) as * i32 ;
167
165
let val = from_be32 ( * ptr) as u32 ;
168
166
169
167
let i = ( val >> 28 u) as uint ;
Original file line number Diff line number Diff line change @@ -351,10 +351,8 @@ impl Float for f32 {
351
351
static EXP_MASK : u32 = 0x7f800000 ;
352
352
static MAN_MASK : u32 = 0x007fffff ;
353
353
354
- match (
355
- unsafe { :: cast:: transmute :: < f32 , u32 > ( * self ) } & MAN_MASK ,
356
- unsafe { :: cast:: transmute :: < f32 , u32 > ( * self ) } & EXP_MASK ,
357
- ) {
354
+ let bits: u32 = unsafe { :: cast:: transmute ( * self ) } ;
355
+ match ( bits & MAN_MASK , bits & EXP_MASK ) {
358
356
( 0 , 0 ) => FPZero ,
359
357
( _, 0 ) => FPSubnormal ,
360
358
( 0 , EXP_MASK ) => FPInfinite ,
Original file line number Diff line number Diff line change @@ -353,10 +353,8 @@ impl Float for f64 {
353
353
static EXP_MASK : u64 = 0x7ff0000000000000 ;
354
354
static MAN_MASK : u64 = 0x000fffffffffffff ;
355
355
356
- match (
357
- unsafe { :: cast:: transmute :: < f64 , u64 > ( * self ) } & MAN_MASK ,
358
- unsafe { :: cast:: transmute :: < f64 , u64 > ( * self ) } & EXP_MASK ,
359
- ) {
356
+ let bits: u64 = unsafe { :: cast:: transmute ( * self ) } ;
357
+ match ( bits & MAN_MASK , bits & EXP_MASK ) {
360
358
( 0 , 0 ) => FPZero ,
361
359
( _, 0 ) => FPSubnormal ,
362
360
( 0 , EXP_MASK ) => FPInfinite ,
You can’t perform that action at this time.
0 commit comments