@@ -2227,12 +2227,12 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
2227
2227
// print some primitives
2228
2228
if let ConstValue :: Scalar ( Scalar :: Bits { bits, .. } ) = value {
2229
2229
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) => {
2236
2236
let bit_width = ty:: tls:: with ( |tcx| {
2237
2237
let ty = tcx. lift_to_global ( & ty) . unwrap ( ) ;
2238
2238
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 {
2243
2243
let shift = 128 - bit_width;
2244
2244
return write ! ( f, "{:?}{}" , ( ( bits as i128 ) << shift) >> shift, i) ;
2245
2245
}
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( ) ) ,
2247
2247
_ => { } ,
2248
2248
}
2249
2249
}
@@ -2255,7 +2255,7 @@ pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
2255
2255
if let ConstValue :: ScalarPair ( ptr, len) = value {
2256
2256
if let Scalar :: Ptr ( ptr) = ptr {
2257
2257
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 {
2259
2259
return ty:: tls:: with ( |tcx| {
2260
2260
let alloc = tcx. alloc_map . lock ( ) . get ( ptr. alloc_id ) ;
2261
2261
if let Some ( interpret:: AllocType :: Memory ( alloc) ) = alloc {
0 commit comments