@@ -503,7 +503,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
503503                    value. to_bool( ) , 
504504                    self . path, 
505505                    err_ub!( InvalidBool ( ..) )  | err_ub!( InvalidUninitBytes ( None ) )  =>
506-                         {  "{}" ,  value }  expected {  "a boolean"  } , 
506+                         {  "{:x }" ,  value }  expected {  "a boolean"  } , 
507507                ) ; 
508508                Ok ( true ) 
509509            } 
@@ -513,7 +513,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
513513                    value. to_char( ) , 
514514                    self . path, 
515515                    err_ub!( InvalidChar ( ..) )  | err_ub!( InvalidUninitBytes ( None ) )  =>
516-                         {  "{}" ,  value }  expected {  "a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)"  } , 
516+                         {  "{:x }" ,  value }  expected {  "a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)"  } , 
517517                ) ; 
518518                Ok ( true ) 
519519            } 
@@ -526,7 +526,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
526526                    let  is_bits = value. check_init ( ) . map_or ( false ,  |v| v. try_to_int ( ) . is_ok ( ) ) ; 
527527                    if  !is_bits { 
528528                        throw_validation_failure ! ( self . path, 
529-                             {  "{}" ,  value }  expected {  "initialized plain (non-pointer) bytes"  } 
529+                             {  "{:x }" ,  value }  expected {  "initialized plain (non-pointer) bytes"  } 
530530                        ) 
531531                    } 
532532                } 
@@ -580,7 +580,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
580580                    err_ub!( DanglingIntPointer ( ..) )  |
581581                    err_ub!( InvalidFunctionPointer ( ..) )  |
582582                    err_ub!( InvalidUninitBytes ( None ) )  =>
583-                         {  "{}" ,  value }  expected {  "a function pointer"  } , 
583+                         {  "{:x }" ,  value }  expected {  "a function pointer"  } , 
584584                ) ; 
585585                // FIXME: Check if the signature matches 
586586                Ok ( true ) 
@@ -632,7 +632,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
632632        let  value = try_validation ! ( 
633633            value. check_init( ) , 
634634            self . path, 
635-             err_ub!( InvalidUninitBytes ( None ) )  => {  "{}" ,  value } 
635+             err_ub!( InvalidUninitBytes ( None ) )  => {  "{:x }" ,  value } 
636636                expected {  "something {}" ,  wrapping_range_format( valid_range,  max_value)  } , 
637637        ) ; 
638638        let  bits = match  value. try_to_int ( )  { 
0 commit comments