@@ -509,14 +509,12 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
509509 let value = self . read_scalar ( value) ?;
510510 // NOTE: Keep this in sync with the array optimization for int/float
511511 // 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+ ) ;
520518 // As a special exception we *do* match on a `Scalar` here, since we truly want
521519 // to know its underlying representation (and *not* cast it to an integer).
522520 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, '
621619 // i.e. that we go over the `check_init` below.
622620 let size = scalar_layout. size ( self . ecx ) ;
623621 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
631623 ScalarAbi :: Union { .. } => true ,
632624 } ;
633625 if is_full_range {
@@ -903,7 +895,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
903895
904896 match alloc. check_bytes (
905897 alloc_range ( Size :: ZERO , size) ,
906- /*allow_uninit*/ ! M :: enforce_number_init ( self . ecx ) ,
898+ /*allow_uninit*/ false ,
907899 /*allow_ptr*/ false ,
908900 ) {
909901 // In the happy case, we needn't check anything else.
0 commit comments