Skip to content

Commit c392fbb

Browse files
committed
Adjust generics to Allocation parameters
1 parent 7c9d786 commit c392fbb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/librustc/mir/interpret/allocation.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
5959
/// If you want to check bounds before doing a memory access, better use `check_bounds`.
6060
pub fn check_bounds_ptr(
6161
&self,
62-
ptr: Pointer<M::PointerTag>,
62+
ptr: Pointer<Tag>,
6363
check: InboundsCheck,
6464
) -> EvalResult<'tcx> {
6565
let allocation_size = match check {
@@ -85,7 +85,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
8585
#[inline(always)]
8686
pub fn check_bounds(
8787
&self,
88-
ptr: Pointer<M::PointerTag>,
88+
ptr: Pointer<Tag>,
8989
size: Size,
9090
check: InboundsCheck,
9191
) -> EvalResult<'tcx> {
@@ -183,9 +183,9 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
183183
/// Return all relocations overlapping with the given ptr-offset pair.
184184
fn relocations(
185185
&self,
186-
ptr: Pointer<M::PointerTag>,
186+
ptr: Pointer<Tag>,
187187
size: Size,
188-
) -> EvalResult<'tcx, &[(Size, (M::PointerTag, AllocId))]> {
188+
) -> EvalResult<'tcx, &[(Size, (Tag, AllocId))]> {
189189
// We have to go back `pointer_size - 1` bytes, as that one would still overlap with
190190
// the beginning of this range.
191191
let start = ptr.offset.bytes().saturating_sub(self.pointer_size().bytes() - 1);
@@ -195,7 +195,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
195195

196196
/// Check that there ar eno relocations overlapping with the given range.
197197
#[inline(always)]
198-
fn check_relocations(&self, ptr: Pointer<M::PointerTag>, size: Size) -> EvalResult<'tcx> {
198+
fn check_relocations(&self, ptr: Pointer<Tag>, size: Size) -> EvalResult<'tcx> {
199199
if self.relocations(ptr, size)?.len() != 0 {
200200
err!(ReadPointerAsBytes)
201201
} else {
@@ -209,7 +209,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
209209
/// uninitialized. This is a somewhat odd "spooky action at a distance",
210210
/// but it allows strictly more code to run than if we would just error
211211
/// immediately in that case.
212-
fn clear_relocations(&mut self, ptr: Pointer<M::PointerTag>, size: Size) -> EvalResult<'tcx> {
212+
fn clear_relocations(&mut self, ptr: Pointer<Tag>, size: Size) -> EvalResult<'tcx> {
213213
// Find the start and end of the given range and its outermost relocations.
214214
let (first, last) = {
215215
// Find all relocations overlapping the given range.
@@ -244,7 +244,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
244244
/// Error if there are relocations overlapping with the edges of the
245245
/// given memory range.
246246
#[inline]
247-
fn check_relocation_edges(&self, ptr: Pointer<M::PointerTag>, size: Size) -> EvalResult<'tcx> {
247+
fn check_relocation_edges(&self, ptr: Pointer<Tag>, size: Size) -> EvalResult<'tcx> {
248248
self.check_relocations(ptr, Size::ZERO)?;
249249
self.check_relocations(ptr.offset(size, self)?, Size::ZERO)?;
250250
Ok(())
@@ -257,7 +257,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
257257
/// Checks that a range of bytes is defined. If not, returns the `ReadUndefBytes`
258258
/// error which will report the first byte which is undefined.
259259
#[inline]
260-
fn check_defined(&self, ptr: Pointer<M::PointerTag>, size: Size) -> EvalResult<'tcx> {
260+
fn check_defined(&self, ptr: Pointer<Tag>, size: Size) -> EvalResult<'tcx> {
261261
let alloc = self.get(ptr.alloc_id)?;
262262
alloc.undef_mask.is_range_defined(
263263
ptr.offset,
@@ -267,7 +267,7 @@ impl<'tcx, Tag, Extra> Allocation<Tag, Extra> {
267267

268268
pub fn mark_definedness(
269269
&mut self,
270-
ptr: Pointer<M::PointerTag>,
270+
ptr: Pointer<Tag>,
271271
size: Size,
272272
new_state: bool,
273273
) -> EvalResult<'tcx> {

0 commit comments

Comments
 (0)