@@ -132,8 +132,8 @@ impl PrimitiveExt for Primitive {
132132 fn to_ty < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Ty < ' tcx > {
133133 match * self {
134134 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 ,
137137 Pointer => tcx. mk_mut_ptr ( tcx. mk_unit ( ) ) ,
138138 }
139139 }
@@ -144,7 +144,7 @@ impl PrimitiveExt for Primitive {
144144 match * self {
145145 Int ( i, signed) => i. to_ty ( tcx, signed) ,
146146 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" ) ,
148148 }
149149 }
150150}
@@ -538,10 +538,10 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
538538 ty:: Uint ( ity) => {
539539 scalar ( Int ( Integer :: from_attr ( dl, attr:: UnsignedInt ( ity) ) , false ) )
540540 }
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+ } ) ,
545545 ty:: FnPtr ( _) => {
546546 let mut ptr = scalar_unit ( Pointer ) ;
547547 ptr. valid_range = 1 ..=* ptr. valid_range . end ( ) ;
@@ -2457,7 +2457,8 @@ impl_stable_hash_for!(enum crate::ty::layout::Integer {
24572457
24582458impl_stable_hash_for ! ( enum crate :: ty:: layout:: Primitive {
24592459 Int ( integer, signed) ,
2460- Float ( fty) ,
2460+ F32 ,
2461+ F64 ,
24612462 Pointer
24622463} ) ;
24632464
0 commit comments