@@ -606,7 +606,7 @@ impl<'tcx, Tag> ScalarMaybeUninit<Tag> {
606
606
}
607
607
608
608
#[ inline]
609
- pub fn not_undef ( self ) -> InterpResult < ' static , Scalar < Tag > > {
609
+ pub fn check_init ( self ) -> InterpResult < ' static , Scalar < Tag > > {
610
610
match self {
611
611
ScalarMaybeUninit :: Scalar ( scalar) => Ok ( scalar) ,
612
612
ScalarMaybeUninit :: Uninit => throw_ub ! ( InvalidUninitBytes ( None ) ) ,
@@ -615,72 +615,72 @@ impl<'tcx, Tag> ScalarMaybeUninit<Tag> {
615
615
616
616
#[ inline( always) ]
617
617
pub fn to_bool ( self ) -> InterpResult < ' tcx , bool > {
618
- self . not_undef ( ) ?. to_bool ( )
618
+ self . check_init ( ) ?. to_bool ( )
619
619
}
620
620
621
621
#[ inline( always) ]
622
622
pub fn to_char ( self ) -> InterpResult < ' tcx , char > {
623
- self . not_undef ( ) ?. to_char ( )
623
+ self . check_init ( ) ?. to_char ( )
624
624
}
625
625
626
626
#[ inline( always) ]
627
627
pub fn to_f32 ( self ) -> InterpResult < ' tcx , Single > {
628
- self . not_undef ( ) ?. to_f32 ( )
628
+ self . check_init ( ) ?. to_f32 ( )
629
629
}
630
630
631
631
#[ inline( always) ]
632
632
pub fn to_f64 ( self ) -> InterpResult < ' tcx , Double > {
633
- self . not_undef ( ) ?. to_f64 ( )
633
+ self . check_init ( ) ?. to_f64 ( )
634
634
}
635
635
636
636
#[ inline( always) ]
637
637
pub fn to_u8 ( self ) -> InterpResult < ' tcx , u8 > {
638
- self . not_undef ( ) ?. to_u8 ( )
638
+ self . check_init ( ) ?. to_u8 ( )
639
639
}
640
640
641
641
#[ inline( always) ]
642
642
pub fn to_u16 ( self ) -> InterpResult < ' tcx , u16 > {
643
- self . not_undef ( ) ?. to_u16 ( )
643
+ self . check_init ( ) ?. to_u16 ( )
644
644
}
645
645
646
646
#[ inline( always) ]
647
647
pub fn to_u32 ( self ) -> InterpResult < ' tcx , u32 > {
648
- self . not_undef ( ) ?. to_u32 ( )
648
+ self . check_init ( ) ?. to_u32 ( )
649
649
}
650
650
651
651
#[ inline( always) ]
652
652
pub fn to_u64 ( self ) -> InterpResult < ' tcx , u64 > {
653
- self . not_undef ( ) ?. to_u64 ( )
653
+ self . check_init ( ) ?. to_u64 ( )
654
654
}
655
655
656
656
#[ inline( always) ]
657
657
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)
659
659
}
660
660
661
661
#[ inline( always) ]
662
662
pub fn to_i8 ( self ) -> InterpResult < ' tcx , i8 > {
663
- self . not_undef ( ) ?. to_i8 ( )
663
+ self . check_init ( ) ?. to_i8 ( )
664
664
}
665
665
666
666
#[ inline( always) ]
667
667
pub fn to_i16 ( self ) -> InterpResult < ' tcx , i16 > {
668
- self . not_undef ( ) ?. to_i16 ( )
668
+ self . check_init ( ) ?. to_i16 ( )
669
669
}
670
670
671
671
#[ inline( always) ]
672
672
pub fn to_i32 ( self ) -> InterpResult < ' tcx , i32 > {
673
- self . not_undef ( ) ?. to_i32 ( )
673
+ self . check_init ( ) ?. to_i32 ( )
674
674
}
675
675
676
676
#[ inline( always) ]
677
677
pub fn to_i64 ( self ) -> InterpResult < ' tcx , i64 > {
678
- self . not_undef ( ) ?. to_i64 ( )
678
+ self . check_init ( ) ?. to_i64 ( )
679
679
}
680
680
681
681
#[ inline( always) ]
682
682
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)
684
684
}
685
685
}
686
686
0 commit comments