@@ -2227,12 +2227,12 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
22272227 // print some primitives
22282228 if let ConstValue :: Scalar ( Scalar :: Bits { bits, .. } ) = value {
22292229 match ty. sty {
2230- TyBool if bits == 0 => return write ! ( f, "false" ) ,
2231- TyBool if bits == 1 => return write ! ( f, "true" ) ,
2232- TyFloat ( ast:: FloatTy :: F32 ) => return write ! ( f, "{}f32" , Single :: from_bits( bits) ) ,
2233- TyFloat ( ast:: FloatTy :: F64 ) => return write ! ( f, "{}f64" , Double :: from_bits( bits) ) ,
2234- TyUint ( ui) => return write ! ( f, "{:?}{}" , bits, ui) ,
2235- TyInt ( i) => {
2230+ Bool if bits == 0 => return write ! ( f, "false" ) ,
2231+ Bool if bits == 1 => return write ! ( f, "true" ) ,
2232+ Float ( ast:: FloatTy :: F32 ) => return write ! ( f, "{}f32" , Single :: from_bits( bits) ) ,
2233+ Float ( ast:: FloatTy :: F64 ) => return write ! ( f, "{}f64" , Double :: from_bits( bits) ) ,
2234+ Uint ( ui) => return write ! ( f, "{:?}{}" , bits, ui) ,
2235+ Int ( i) => {
22362236 let bit_width = ty:: tls:: with ( |tcx| {
22372237 let ty = tcx. lift_to_global ( & ty) . unwrap ( ) ;
22382238 tcx. layout_of ( ty:: ParamEnv :: empty ( ) . and ( ty) )
@@ -2243,7 +2243,7 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
22432243 let shift = 128 - bit_width;
22442244 return write ! ( f, "{:?}{}" , ( ( bits as i128 ) << shift) >> shift, i) ;
22452245 }
2246- TyChar => return write ! ( f, "{:?}" , :: std:: char :: from_u32( bits as u32 ) . unwrap( ) ) ,
2246+ Char => return write ! ( f, "{:?}" , :: std:: char :: from_u32( bits as u32 ) . unwrap( ) ) ,
22472247 _ => { } ,
22482248 }
22492249 }
@@ -2255,7 +2255,7 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
22552255 if let ConstValue :: ScalarPair ( ptr, len) = value {
22562256 if let Scalar :: Ptr ( ptr) = ptr {
22572257 if let ScalarMaybeUndef :: Scalar ( Scalar :: Bits { bits : len, .. } ) = len {
2258- if let Ref ( _, & ty:: TyS { sty : TyStr , .. } , _) = ty. sty {
2258+ if let Ref ( _, & ty:: TyS { sty : Str , .. } , _) = ty. sty {
22592259 return ty:: tls:: with ( |tcx| {
22602260 let alloc = tcx. alloc_map . lock ( ) . get ( ptr. alloc_id ) ;
22612261 if let Some ( interpret:: AllocType :: Memory ( alloc) ) = alloc {
0 commit comments