@@ -503,7 +503,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
503
503
value. to_bool( ) ,
504
504
self . path,
505
505
err_ub!( InvalidBool ( ..) ) | err_ub!( InvalidUninitBytes ( None ) ) =>
506
- { "{}" , value } expected { "a boolean" } ,
506
+ { "{:x }" , value } expected { "a boolean" } ,
507
507
) ;
508
508
Ok ( true )
509
509
}
@@ -513,7 +513,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
513
513
value. to_char( ) ,
514
514
self . path,
515
515
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`)" } ,
517
517
) ;
518
518
Ok ( true )
519
519
}
@@ -526,7 +526,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
526
526
let is_bits = value. check_init ( ) . map_or ( false , |v| v. try_to_int ( ) . is_ok ( ) ) ;
527
527
if !is_bits {
528
528
throw_validation_failure ! ( self . path,
529
- { "{}" , value } expected { "initialized plain (non-pointer) bytes" }
529
+ { "{:x }" , value } expected { "initialized plain (non-pointer) bytes" }
530
530
)
531
531
}
532
532
}
@@ -580,7 +580,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
580
580
err_ub!( DanglingIntPointer ( ..) ) |
581
581
err_ub!( InvalidFunctionPointer ( ..) ) |
582
582
err_ub!( InvalidUninitBytes ( None ) ) =>
583
- { "{}" , value } expected { "a function pointer" } ,
583
+ { "{:x }" , value } expected { "a function pointer" } ,
584
584
) ;
585
585
// FIXME: Check if the signature matches
586
586
Ok ( true )
@@ -632,7 +632,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
632
632
let value = try_validation ! (
633
633
value. check_init( ) ,
634
634
self . path,
635
- err_ub!( InvalidUninitBytes ( None ) ) => { "{}" , value }
635
+ err_ub!( InvalidUninitBytes ( None ) ) => { "{:x }" , value }
636
636
expected { "something {}" , wrapping_range_format( valid_range, max_value) } ,
637
637
) ;
638
638
let bits = match value. try_to_int ( ) {
0 commit comments