Skip to content

Commit ebe0459

Browse files
committed
Renamed a function that checks if a range is initialized.
1 parent 482411a commit ebe0459

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_middle/mir/interpret/allocation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
162162
&self.bytes[range]
163163
}
164164

165-
/// Returns the undef mask.
165+
/// Returns the uninit mask.
166166
pub fn uninit_mask(&self) -> &UninitMask {
167167
&self.uninit_mask
168168
}
@@ -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.uninit_mask.is_range_defined(ptr.offset, ptr.offset + size) // `Size` addition
553+
self.uninit_mask.is_range_initialized(ptr.offset, ptr.offset + size) // `Size` addition
554554
}
555555

556556
/// Checks that a range of bytes is defined. If not, returns the `ReadUndefBytes`
@@ -763,7 +763,7 @@ impl UninitMask {
763763
/// Returns `Ok(())` if it's initialized. Otherwise returns the index of the byte
764764
/// at which the first uninitialized access begins.
765765
#[inline]
766-
pub fn is_range_defined(&self, start: Size, end: Size) -> Result<(), Size> {
766+
pub fn is_range_initialized(&self, start: Size, end: Size) -> Result<(), Size> {
767767
if end > self.len {
768768
return Err(self.len);
769769
}

src/librustc_mir/util/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ fn write_allocation_bytes<Tag, Extra>(
767767
ascii.push('╼');
768768
i += ptr_size;
769769
}
770-
} else if alloc.uninit_mask().is_range_defined(i, i + Size::from_bytes(1)).is_ok() {
770+
} else if alloc.uninit_mask().is_range_initialized(i, i + Size::from_bytes(1)).is_ok() {
771771
let j = i.bytes_usize();
772772

773773
// Checked definedness (and thus range) and relocations. This access also doesn't

0 commit comments

Comments
 (0)