pub extra: Extra,
}
-pub trait AllocationExtra<Tag>: ::std::fmt::Debug + Clone {
+pub trait AllocationExtra<Tag>: std::fmt::Debug + Clone {
// There is no constructor in here because the constructor's type depends
// on `MemoryKind`, and making things sufficiently generic leads to painful
// inference failure.
let range = self.check_bounds(ptr.offset, size);
self.mark_init(ptr, size, true);
- self.clear_relocations(cx, ptr, size)?;
+ self.clear_relocations(cx, ptr, size);
AllocationExtra::memory_written(self, ptr, size)?;
/// uninitialized. This is a somewhat odd "spooky action at a distance",
/// but it allows strictly more code to run than if we would just error
/// immediately in that case.
- fn clear_relocations(
- &mut self,
- cx: &impl HasDataLayout,
- ptr: Pointer<Tag>,
- size: Size,
- ) -> InterpResult<'tcx> {
+ fn clear_relocations(&mut self, cx: &impl HasDataLayout, ptr: Pointer<Tag>, size: Size) {
// Find the start and end of the given range and its outermost relocations.
let (first, last) = {
// Find all relocations overlapping the given range.
let relocations = self.get_relocations(cx, ptr, size);
if relocations.is_empty() {
- return Ok(());
+ return;
}
(
// Forget all the relocations.
self.relocations.remove_range(first..last);
-
- Ok(())
}
/// Errors if there are relocations overlapping with the edges of the