Skip to content

Commit

Permalink
remove write_repeat; it is subsumed by the new write_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Oct 21, 2019
1 parent d4b3654 commit f6d70b4
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/librustc/mir/interpret/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,25 +367,6 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
Ok(())
}

/// Sets `count` bytes starting at `ptr.offset` with `val`. Basically `memset`.
///
/// It is the caller's responsibility to check bounds and alignment beforehand.
/// Most likely, you want to call `Memory::write_bytes` instead of this method.
pub fn write_repeat(
&mut self,
cx: &impl HasDataLayout,
ptr: Pointer<Tag>,
val: u8,
count: Size
) -> InterpResult<'tcx>
{
let bytes = self.get_bytes_mut(cx, ptr, count)?;
for b in bytes {
*b = val;
}
Ok(())
}

/// Reads a *non-ZST* scalar.
///
/// ZSTs can't be read for two reasons:
Expand Down

0 comments on commit f6d70b4

Please sign in to comment.