match pick.kind {
probe::InherentImplPick(impl_def_id) => {
assert!(ty::impl_trait_ref(self.tcx(), impl_def_id).is_none(),
- "impl {} is not an inherent impl", impl_def_id);
+ "impl {:?} is not an inherent impl", impl_def_id);
let impl_polytype = check::impl_self_ty(self.fcx, self.span, impl_def_id);
(impl_polytype.substs, MethodStatic(pick.method_ty.def_id))
self.tcx().sess.span_bug(
self.span,
format!("self-type `{}` for ObjectPick never dereferenced to an object",
- self_ty.repr(self.tcx()))[])
+ self_ty.repr(self.tcx())).index(&FullRange))
}
}
}
format!(
"{} was a subtype of {} but now is not?",
self_ty.repr(self.tcx()),
- method_self_ty.repr(self.tcx()))[]);
+ method_self_ty.repr(self.tcx())).index(&FullRange));
}
}
}
self.fcx.adjust_expr_ty(
&**base_expr,
Some(&ty::AdjustDerefRef(base_adjustment.clone())));
+ let index_expr_ty = self.fcx.expr_ty(&**index_expr);
let result = check::try_index_step(
self.fcx,
&**base_expr,
adjusted_base_ty,
base_adjustment,
- PreferMutLvalue);
+ PreferMutLvalue,
+ index_expr_ty);
if let Some((input_ty, return_ty)) = result {
- let index_expr_ty = self.fcx.expr_ty(&**index_expr);
demand::suptype(self.fcx, index_expr.span, input_ty, index_expr_ty);
let expr_ty = self.fcx.expr_ty(&**expr);
self.span,
format!("cannot upcast `{}` to `{}`",
source_trait_ref.repr(self.tcx()),
- target_trait_def_id.repr(self.tcx()))[]);
+ target_trait_def_id.repr(self.tcx())).as_slice());
}
}
}