@@ -132,8 +132,8 @@ impl PrimitiveExt for Primitive {
132
132
fn to_ty < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Ty < ' tcx > {
133
133
match * self {
134
134
Int ( i, signed) => i. to_ty ( tcx, signed) ,
135
- Float ( FloatTy :: F32 ) => tcx. types . f32 ,
136
- Float ( FloatTy :: F64 ) => tcx. types . f64 ,
135
+ F32 => tcx. types . f32 ,
136
+ F64 => tcx. types . f64 ,
137
137
Pointer => tcx. mk_mut_ptr ( tcx. mk_unit ( ) ) ,
138
138
}
139
139
}
@@ -144,7 +144,7 @@ impl PrimitiveExt for Primitive {
144
144
match * self {
145
145
Int ( i, signed) => i. to_ty ( tcx, signed) ,
146
146
Pointer => tcx. types . usize ,
147
- Float ( .. ) => bug ! ( "floats do not have an int type" ) ,
147
+ F32 | F64 => bug ! ( "floats do not have an int type" ) ,
148
148
}
149
149
}
150
150
}
@@ -538,10 +538,10 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
538
538
ty:: Uint ( ity) => {
539
539
scalar ( Int ( Integer :: from_attr ( dl, attr:: UnsignedInt ( ity) ) , false ) )
540
540
}
541
- ty:: Float ( fty) => scalar ( Float ( match fty {
542
- ast:: FloatTy :: F32 => FloatTy :: F32 ,
543
- ast:: FloatTy :: F64 => FloatTy :: F64 ,
544
- } ) ) ,
541
+ ty:: Float ( fty) => scalar ( match fty {
542
+ ast:: FloatTy :: F32 => F32 ,
543
+ ast:: FloatTy :: F64 => F64 ,
544
+ } ) ,
545
545
ty:: FnPtr ( _) => {
546
546
let mut ptr = scalar_unit ( Pointer ) ;
547
547
ptr. valid_range = 1 ..=* ptr. valid_range . end ( ) ;
@@ -2457,7 +2457,8 @@ impl_stable_hash_for!(enum crate::ty::layout::Integer {
2457
2457
2458
2458
impl_stable_hash_for ! ( enum crate :: ty:: layout:: Primitive {
2459
2459
Int ( integer, signed) ,
2460
- Float ( fty) ,
2460
+ F32 ,
2461
+ F64 ,
2461
2462
Pointer
2462
2463
} ) ;
2463
2464
0 commit comments