@@ -606,7 +606,7 @@ impl<'tcx, Tag> ScalarMaybeUninit<Tag> {
606606 }
607607
608608 #[ inline]
609- pub fn not_undef ( self ) -> InterpResult < ' static , Scalar < Tag > > {
609+ pub fn check_init ( self ) -> InterpResult < ' static , Scalar < Tag > > {
610610 match self {
611611 ScalarMaybeUninit :: Scalar ( scalar) => Ok ( scalar) ,
612612 ScalarMaybeUninit :: Uninit => throw_ub ! ( InvalidUninitBytes ( None ) ) ,
@@ -615,72 +615,72 @@ impl<'tcx, Tag> ScalarMaybeUninit<Tag> {
615615
616616 #[ inline( always) ]
617617 pub fn to_bool ( self ) -> InterpResult < ' tcx , bool > {
618- self . not_undef ( ) ?. to_bool ( )
618+ self . check_init ( ) ?. to_bool ( )
619619 }
620620
621621 #[ inline( always) ]
622622 pub fn to_char ( self ) -> InterpResult < ' tcx , char > {
623- self . not_undef ( ) ?. to_char ( )
623+ self . check_init ( ) ?. to_char ( )
624624 }
625625
626626 #[ inline( always) ]
627627 pub fn to_f32 ( self ) -> InterpResult < ' tcx , Single > {
628- self . not_undef ( ) ?. to_f32 ( )
628+ self . check_init ( ) ?. to_f32 ( )
629629 }
630630
631631 #[ inline( always) ]
632632 pub fn to_f64 ( self ) -> InterpResult < ' tcx , Double > {
633- self . not_undef ( ) ?. to_f64 ( )
633+ self . check_init ( ) ?. to_f64 ( )
634634 }
635635
636636 #[ inline( always) ]
637637 pub fn to_u8 ( self ) -> InterpResult < ' tcx , u8 > {
638- self . not_undef ( ) ?. to_u8 ( )
638+ self . check_init ( ) ?. to_u8 ( )
639639 }
640640
641641 #[ inline( always) ]
642642 pub fn to_u16 ( self ) -> InterpResult < ' tcx , u16 > {
643- self . not_undef ( ) ?. to_u16 ( )
643+ self . check_init ( ) ?. to_u16 ( )
644644 }
645645
646646 #[ inline( always) ]
647647 pub fn to_u32 ( self ) -> InterpResult < ' tcx , u32 > {
648- self . not_undef ( ) ?. to_u32 ( )
648+ self . check_init ( ) ?. to_u32 ( )
649649 }
650650
651651 #[ inline( always) ]
652652 pub fn to_u64 ( self ) -> InterpResult < ' tcx , u64 > {
653- self . not_undef ( ) ?. to_u64 ( )
653+ self . check_init ( ) ?. to_u64 ( )
654654 }
655655
656656 #[ inline( always) ]
657657 pub fn to_machine_usize ( self , cx : & impl HasDataLayout ) -> InterpResult < ' tcx , u64 > {
658- self . not_undef ( ) ?. to_machine_usize ( cx)
658+ self . check_init ( ) ?. to_machine_usize ( cx)
659659 }
660660
661661 #[ inline( always) ]
662662 pub fn to_i8 ( self ) -> InterpResult < ' tcx , i8 > {
663- self . not_undef ( ) ?. to_i8 ( )
663+ self . check_init ( ) ?. to_i8 ( )
664664 }
665665
666666 #[ inline( always) ]
667667 pub fn to_i16 ( self ) -> InterpResult < ' tcx , i16 > {
668- self . not_undef ( ) ?. to_i16 ( )
668+ self . check_init ( ) ?. to_i16 ( )
669669 }
670670
671671 #[ inline( always) ]
672672 pub fn to_i32 ( self ) -> InterpResult < ' tcx , i32 > {
673- self . not_undef ( ) ?. to_i32 ( )
673+ self . check_init ( ) ?. to_i32 ( )
674674 }
675675
676676 #[ inline( always) ]
677677 pub fn to_i64 ( self ) -> InterpResult < ' tcx , i64 > {
678- self . not_undef ( ) ?. to_i64 ( )
678+ self . check_init ( ) ?. to_i64 ( )
679679 }
680680
681681 #[ inline( always) ]
682682 pub fn to_machine_isize ( self , cx : & impl HasDataLayout ) -> InterpResult < ' tcx , i64 > {
683- self . not_undef ( ) ?. to_machine_isize ( cx)
683+ self . check_init ( ) ?. to_machine_isize ( cx)
684684 }
685685}
686686
0 commit comments