@@ -27,7 +27,7 @@ pub struct Allocation<Tag = (), Extra = ()> {
2727 /// at the given offset.
2828 relocations : Relocations < Tag > ,
2929 /// Denotes which part of this allocation is initialized.
30- undef_mask : UninitMask ,
30+ uninit_mask : UninitMask ,
3131 /// The size of the allocation. Currently, must always equal `bytes.len()`.
3232 pub size : Size ,
3333 /// The alignment of the allocation to detect unaligned reads.
@@ -94,7 +94,7 @@ impl<Tag> Allocation<Tag> {
9494 Self {
9595 bytes,
9696 relocations : Relocations :: new ( ) ,
97- undef_mask : UninitMask :: new ( size, true ) ,
97+ uninit_mask : UninitMask :: new ( size, true ) ,
9898 size,
9999 align,
100100 mutability : Mutability :: Not ,
@@ -110,7 +110,7 @@ impl<Tag> Allocation<Tag> {
110110 Allocation {
111111 bytes : vec ! [ 0 ; size. bytes_usize( ) ] ,
112112 relocations : Relocations :: new ( ) ,
113- undef_mask : UninitMask :: new ( size, false ) ,
113+ uninit_mask : UninitMask :: new ( size, false ) ,
114114 size,
115115 align,
116116 mutability : Mutability :: Mut ,
@@ -140,7 +140,7 @@ impl Allocation<(), ()> {
140140 } )
141141 . collect ( ) ,
142142 ) ,
143- undef_mask : self . undef_mask ,
143+ uninit_mask : self . uninit_mask ,
144144 align : self . align ,
145145 mutability : self . mutability ,
146146 extra,
@@ -163,8 +163,8 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
163163 }
164164
165165 /// Returns the undef mask.
166- pub fn undef_mask ( & self ) -> & UninitMask {
167- & self . undef_mask
166+ pub fn uninit_mask ( & self ) -> & UninitMask {
167+ & self . uninit_mask
168168 }
169169
170170 /// Returns the relocation list.
@@ -363,12 +363,12 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
363363 ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
364364 // `get_bytes_unchecked` tests relocation edges.
365365 let bytes = self . get_bytes_with_undef_and_ptr ( cx, ptr, size) ?;
366- // Undef check happens *after* we established that the alignment is correct.
366+ // Uninit check happens *after* we established that the alignment is correct.
367367 // We must not return `Ok()` for unaligned pointers!
368368 if self . is_defined ( ptr, size) . is_err ( ) {
369- // This inflates undefined bytes to the entire scalar, even if only a few
370- // bytes are undefined .
371- return Ok ( ScalarMaybeUninit :: Undef ) ;
369+ // This inflates uninitialized bytes to the entire scalar, even if only a few
370+ // bytes are uninitialized .
371+ return Ok ( ScalarMaybeUninit :: Uninit ) ;
372372 }
373373 // Now we do the actual reading.
374374 let bits = read_target_uint ( cx. data_layout ( ) . endian , bytes) . unwrap ( ) ;
@@ -416,7 +416,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
416416 ) -> InterpResult < ' tcx > {
417417 let val = match val {
418418 ScalarMaybeUninit :: Scalar ( scalar) => scalar,
419- ScalarMaybeUninit :: Undef => {
419+ ScalarMaybeUninit :: Uninit => {
420420 self . mark_definedness ( ptr, type_size, false ) ;
421421 return Ok ( ( ) ) ;
422422 }
@@ -516,10 +516,10 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
516516 // Mark parts of the outermost relocations as undefined if they partially fall outside the
517517 // given range.
518518 if first < start {
519- self . undef_mask . set_range ( first, start, false ) ;
519+ self . uninit_mask . set_range ( first, start, false ) ;
520520 }
521521 if last > end {
522- self . undef_mask . set_range ( end, last, false ) ;
522+ self . uninit_mask . set_range ( end, last, false ) ;
523523 }
524524
525525 // Forget all the relocations.
@@ -550,7 +550,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
550550 /// Returns `Ok(())` if it's defined. Otherwise returns the index of the byte
551551 /// at which the first undefined access begins.
552552 fn is_defined ( & self , ptr : Pointer < Tag > , size : Size ) -> Result < ( ) , Size > {
553- self . undef_mask . is_range_defined ( ptr. offset , ptr. offset + size) // `Size` addition
553+ self . uninit_mask . is_range_defined ( ptr. offset , ptr. offset + size) // `Size` addition
554554 }
555555
556556 /// Checks that a range of bytes is defined. If not, returns the `ReadUndefBytes`
@@ -564,7 +564,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
564564 if size. bytes ( ) == 0 {
565565 return ;
566566 }
567- self . undef_mask . set_range ( ptr. offset , ptr. offset + size, new_state) ;
567+ self . uninit_mask . set_range ( ptr. offset , ptr. offset + size, new_state) ;
568568 }
569569}
570570
@@ -603,13 +603,13 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
603603 // where each element toggles the state.
604604
605605 let mut ranges = smallvec:: SmallVec :: < [ u64 ; 1 ] > :: new ( ) ;
606- let initial = self . undef_mask . get ( src. offset ) ;
606+ let initial = self . uninit_mask . get ( src. offset ) ;
607607 let mut cur_len = 1 ;
608608 let mut cur = initial;
609609
610610 for i in 1 ..size. bytes ( ) {
611611 // FIXME: optimize to bitshift the current undef block's bits and read the top bit.
612- if self . undef_mask . get ( src. offset + Size :: from_bytes ( i) ) == cur {
612+ if self . uninit_mask . get ( src. offset + Size :: from_bytes ( i) ) == cur {
613613 cur_len += 1 ;
614614 } else {
615615 ranges. push ( cur_len) ;
@@ -634,7 +634,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
634634 // An optimization where we can just overwrite an entire range of definedness bits if
635635 // they are going to be uniformly `1` or `0`.
636636 if defined. ranges . len ( ) <= 1 {
637- self . undef_mask . set_range_inbounds (
637+ self . uninit_mask . set_range_inbounds (
638638 dest. offset ,
639639 dest. offset + size * repeat, // `Size` operations
640640 defined. initial ,
@@ -649,7 +649,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
649649 for range in & defined. ranges {
650650 let old_j = j;
651651 j += range;
652- self . undef_mask . set_range_inbounds (
652+ self . uninit_mask . set_range_inbounds (
653653 Size :: from_bytes ( old_j) ,
654654 Size :: from_bytes ( j) ,
655655 cur,
@@ -741,7 +741,7 @@ impl<Tag: Copy, Extra> Allocation<Tag, Extra> {
741741type Block = u64 ;
742742
743743/// A bitmask where each bit refers to the byte with the same index. If the bit is `true`, the byte
744- /// is defined . If it is `false` the byte is undefined .
744+ /// is initialized . If it is `false` the byte is uninitialized .
745745#[ derive( Clone , Debug , Eq , PartialEq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
746746#[ derive( HashStable ) ]
747747pub struct UninitMask {
@@ -758,10 +758,10 @@ impl UninitMask {
758758 m
759759 }
760760
761- /// Checks whether the range `start..end` (end-exclusive) is entirely defined .
761+ /// Checks whether the range `start..end` (end-exclusive) is entirely initialized .
762762 ///
763- /// Returns `Ok(())` if it's defined . Otherwise returns the index of the byte
764- /// at which the first undefined access begins.
763+ /// Returns `Ok(())` if it's initialized . Otherwise returns the index of the byte
764+ /// at which the first uninitialized access begins.
765765 #[ inline]
766766 pub fn is_range_defined ( & self , start : Size , end : Size ) -> Result < ( ) , Size > {
767767 if end > self . len {
0 commit comments