@@ -509,14 +509,12 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
509
509
let value = self . read_scalar ( value) ?;
510
510
// NOTE: Keep this in sync with the array optimization for int/float
511
511
// types below!
512
- if M :: enforce_number_init ( self . ecx ) {
513
- try_validation ! (
514
- value. check_init( ) ,
515
- self . path,
516
- err_ub!( InvalidUninitBytes ( ..) ) =>
517
- { "{:x}" , value } expected { "initialized bytes" }
518
- ) ;
519
- }
512
+ try_validation ! (
513
+ value. check_init( ) ,
514
+ self . path,
515
+ err_ub!( InvalidUninitBytes ( ..) ) =>
516
+ { "{:x}" , value } expected { "initialized bytes" }
517
+ ) ;
520
518
// As a special exception we *do* match on a `Scalar` here, since we truly want
521
519
// to know its underlying representation (and *not* cast it to an integer).
522
520
let is_ptr = value. check_init ( ) . map_or ( false , |v| matches ! ( v, Scalar :: Ptr ( ..) ) ) ;
@@ -621,13 +619,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
621
619
// i.e. that we go over the `check_init` below.
622
620
let size = scalar_layout. size ( self . ecx ) ;
623
621
let is_full_range = match scalar_layout {
624
- ScalarAbi :: Initialized { .. } => {
625
- if M :: enforce_number_init ( self . ecx ) {
626
- false // not "full" since uninit is not accepted
627
- } else {
628
- scalar_layout. is_always_valid ( self . ecx )
629
- }
630
- }
622
+ ScalarAbi :: Initialized { .. } => false , // not "full" since uninit is not valid
631
623
ScalarAbi :: Union { .. } => true ,
632
624
} ;
633
625
if is_full_range {
@@ -903,7 +895,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
903
895
904
896
match alloc. check_bytes (
905
897
alloc_range ( Size :: ZERO , size) ,
906
- /*allow_uninit*/ ! M :: enforce_number_init ( self . ecx ) ,
898
+ /*allow_uninit*/ false ,
907
899
/*allow_ptr*/ false ,
908
900
) {
909
901
// In the happy case, we needn't check anything else.
0 commit comments