mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
minor fixes
the FIXME was wrong here, there's no need for any special offsetting
This commit is contained in:
@@ -1406,7 +1406,7 @@ fn read_value(&mut self, ptr: Pointer, ty: Ty<'tcx>) -> EvalResult<'tcx, Value>
|
||||
if self.type_is_sized(ty) {
|
||||
PrimVal::from_ptr(p)
|
||||
} else {
|
||||
// FIXME: extract the offset to the tail field for `Box<(i64, i32, [u8])>`
|
||||
trace!("reading fat pointer extra of type {}", ty);
|
||||
let extra = ptr.offset(self.memory.pointer_size() as isize);
|
||||
let extra = match self.tcx.struct_tail(ty).sty {
|
||||
ty::TyTrait(..) => PrimVal::from_ptr(self.memory.read_ptr(extra)?),
|
||||
@@ -1513,7 +1513,7 @@ fn unsize_into(
|
||||
//let dst = adt::MaybeSizedValue::sized(dst);
|
||||
let src_ptr = match src {
|
||||
Value::ByRef(ptr) => ptr,
|
||||
_ => panic!("expected pointer, got {:?}", src),
|
||||
_ => bug!("expected pointer, got {:?}", src),
|
||||
};
|
||||
|
||||
let iter = src_fields.zip(dst_fields).enumerate();
|
||||
|
||||
Reference in New Issue
Block a user