mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
+4
-6
@@ -830,7 +830,7 @@ fn eval_lvalue(&mut self, lvalue: &mir::Lvalue<'tcx>) -> EvalResult<Lvalue> {
|
||||
|
||||
Index(ref operand) => {
|
||||
let elem_size = match base_ty.sty {
|
||||
ty::TyArray(elem_ty, _) => self.type_size(elem_ty),
|
||||
ty::TyArray(elem_ty, _) |
|
||||
ty::TySlice(elem_ty) => self.type_size(elem_ty),
|
||||
_ => panic!("indexing expected an array or slice, got {:?}", base_ty),
|
||||
};
|
||||
@@ -1109,11 +1109,9 @@ fn fulfill_obligation(&self, trait_ref: ty::PolyTraitRef<'tcx>) -> traits::Vtabl
|
||||
let vtable = selection.map(|predicate| {
|
||||
fulfill_cx.register_predicate_obligation(&infcx, predicate);
|
||||
});
|
||||
let vtable = infer::drain_fulfillment_cx_or_panic(
|
||||
infer::drain_fulfillment_cx_or_panic(
|
||||
DUMMY_SP, &infcx, &mut fulfill_cx, &vtable
|
||||
);
|
||||
|
||||
vtable
|
||||
)
|
||||
}
|
||||
|
||||
/// Trait method, which has to be resolved to an impl method.
|
||||
@@ -1166,7 +1164,7 @@ pub fn trait_method(&self, def_id: DefId, substs: &'tcx Substs<'tcx>)
|
||||
}
|
||||
}
|
||||
|
||||
fn pointee_type<'tcx>(ptr_ty: ty::Ty<'tcx>) -> Option<ty::Ty<'tcx>> {
|
||||
fn pointee_type(ptr_ty: ty::Ty) -> Option<ty::Ty> {
|
||||
match ptr_ty.sty {
|
||||
ty::TyRef(_, ty::TypeAndMut { ty, .. }) |
|
||||
ty::TyRawPtr(ty::TypeAndMut { ty, .. }) |
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ pub struct FieldRepr {
|
||||
impl Repr {
|
||||
pub fn size(&self) -> usize {
|
||||
match *self {
|
||||
Repr::Primitive { size } => size,
|
||||
Repr::Primitive { size } |
|
||||
Repr::Aggregate { size, .. } => size,
|
||||
Repr::Array { elem_size, length } => elem_size * length,
|
||||
}
|
||||
@@ -406,7 +406,7 @@ fn relocations(&self, ptr: Pointer, size: usize)
|
||||
fn clear_relocations(&mut self, ptr: Pointer, size: usize) -> EvalResult<()> {
|
||||
// Find all relocations overlapping the given range.
|
||||
let keys: Vec<_> = try!(self.relocations(ptr, size)).map(|(&k, _)| k).collect();
|
||||
if keys.len() == 0 { return Ok(()); }
|
||||
if keys.is_empty() { return Ok(()); }
|
||||
|
||||
// Find the start and end of the given range and its outermost relocations.
|
||||
let start = ptr.offset;
|
||||
|
||||
Reference in New Issue
Block a user