Skip to content

Commit 5b012ed

Browse files
committed
Rename AbstractPtr to Ptr.
1 parent 8405941 commit 5b012ed

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Diff for: src/interpreter/cast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
2828
U64(u) |
2929
IntegerPtr(u) => self.cast_const_int(u, ty, false),
3030
FnPtr(ptr) |
31-
AbstractPtr(ptr) => self.cast_ptr(ptr, ty),
31+
Ptr(ptr) => self.cast_ptr(ptr, ty),
3232
}
3333
}
3434

3535
fn cast_ptr(&self, ptr: Pointer, ty: Ty<'tcx>) -> EvalResult<'tcx, PrimVal> {
3636
use primval::PrimVal::*;
3737
match ty.sty {
3838
ty::TyRef(..) |
39-
ty::TyRawPtr(_) => Ok(AbstractPtr(ptr)),
39+
ty::TyRawPtr(_) => Ok(Ptr(ptr)),
4040
ty::TyFnPtr(_) => Ok(FnPtr(ptr)),
4141
_ => Err(EvalError::Unimplemented(format!("ptr to {:?} cast", ty))),
4242
}

Diff for: src/interpreter/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
246246
self.memory.write_bytes(ptr, s.as_bytes())?;
247247
self.memory.freeze(ptr.alloc_id)?;
248248
Value::ByValPair(
249-
PrimVal::AbstractPtr(ptr),
249+
PrimVal::Ptr(ptr),
250250
self.target_usize_primval(s.len() as u64)
251251
)
252252
}
@@ -255,7 +255,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
255255
let ptr = self.memory.allocate(bs.len(), 1)?;
256256
self.memory.write_bytes(ptr, bs)?;
257257
self.memory.freeze(ptr.alloc_id)?;
258-
Value::ByVal(PrimVal::AbstractPtr(ptr))
258+
Value::ByVal(PrimVal::Ptr(ptr))
259259
}
260260

261261
Struct(_) => unimplemented!(),
@@ -1050,7 +1050,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
10501050
&ty::TyRawPtr(ty::TypeAndMut { ty, .. }) => {
10511051
if self.type_is_sized(ty) {
10521052
match self.memory.read_ptr(ptr) {
1053-
Ok(p) => PrimVal::AbstractPtr(p),
1053+
Ok(p) => PrimVal::Ptr(p),
10541054
Err(EvalError::ReadBytesAsPointer) => {
10551055
PrimVal::IntegerPtr(self.memory.read_usize(ptr)?)
10561056
}

Diff for: src/interpreter/terminator/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
420420
// FIXME: this is a memory leak, should probably add the pointer to the
421421
// current stack.
422422
let first = self.value_to_ptr(args[0].0, args[0].1)?;
423-
args[0].0 = Value::ByVal(PrimVal::AbstractPtr(first));
423+
args[0].0 = Value::ByVal(PrimVal::Ptr(first));
424424
args[0].1 = self.tcx.mk_mut_ptr(args[0].1);
425425
}
426426

Diff for: src/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ impl<'a, 'tcx> Memory<'a, 'tcx> {
530530
PrimVal::F32(f) => self.write_f32(ptr, f),
531531
PrimVal::F64(f) => self.write_f64(ptr, f),
532532
PrimVal::FnPtr(p) |
533-
PrimVal::AbstractPtr(p) => self.write_ptr(ptr, p),
533+
PrimVal::Ptr(p) => self.write_ptr(ptr, p),
534534
}
535535
}
536536

Diff for: src/primval.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub enum PrimVal {
1212
I8(i8), I16(i16), I32(i32), I64(i64),
1313
U8(u8), U16(u16), U32(u32), U64(u64),
1414

15-
AbstractPtr(Pointer),
15+
Ptr(Pointer),
1616
FnPtr(Pointer),
1717
IntegerPtr(u64),
1818
Char(char),
@@ -211,10 +211,10 @@ pub fn binary_op<'tcx>(bin_op: mir::BinOp, left: PrimVal, right: PrimVal) -> Eva
211211

212212
(IntegerPtr(l), IntegerPtr(r)) => int_binops!(IntegerPtr, l, r),
213213

214-
(AbstractPtr(_), IntegerPtr(_)) |
215-
(IntegerPtr(_), AbstractPtr(_)) |
216-
(FnPtr(_), AbstractPtr(_)) |
217-
(AbstractPtr(_), FnPtr(_)) |
214+
(Ptr(_), IntegerPtr(_)) |
215+
(IntegerPtr(_), Ptr(_)) |
216+
(FnPtr(_), Ptr(_)) |
217+
(Ptr(_), FnPtr(_)) |
218218
(FnPtr(_), IntegerPtr(_)) |
219219
(IntegerPtr(_), FnPtr(_)) =>
220220
unrelated_ptr_ops(bin_op)?,
@@ -225,7 +225,7 @@ pub fn binary_op<'tcx>(bin_op: mir::BinOp, left: PrimVal, right: PrimVal) -> Eva
225225
_ => return Err(EvalError::Unimplemented(format!("unimplemented fn ptr comparison: {:?}", bin_op))),
226226
},
227227

228-
(AbstractPtr(l_ptr), AbstractPtr(r_ptr)) => {
228+
(Ptr(l_ptr), Ptr(r_ptr)) => {
229229
if l_ptr.alloc_id != r_ptr.alloc_id {
230230
return Ok((unrelated_ptr_ops(bin_op)?, false));
231231
}

0 commit comments

Comments
 (0)