remove unused span from eq_types (and rustfmt slightly)

This commit is contained in:
Niko Matsakis 2017-11-22 17:30:34 -05:00
parent 18cc0f9f37
commit 506e80c899

View File

@ -178,9 +178,7 @@ fn sanitize_place(&mut self,
let sty = self.sanitize_type(place, sty);
let ty = self.tcx().type_of(def_id);
let ty = self.cx.normalize(&ty, location);
if let Err(terr) = self.cx
.eq_types(self.last_span, ty, sty, location.at_self())
{
if let Err(terr) = self.cx.eq_types(ty, sty, location.at_self()) {
span_mirbug!(
self,
place,
@ -230,7 +228,6 @@ fn sanitize_projection(
debug!("sanitize_projection: {:?} {:?} {:?}", base, pi, place);
let tcx = self.tcx();
let base_ty = base.to_ty(tcx);
let span = self.last_span;
match *pi {
ProjectionElem::Deref => {
let deref_ty = base_ty.builtin_deref(true, ty::LvaluePreference::NoPreference);
@ -316,7 +313,7 @@ fn sanitize_projection(
let fty = self.sanitize_type(place, fty);
match self.field_ty(place, base, field, location) {
Ok(ty) => {
if let Err(terr) = self.cx.eq_types(span, ty, fty, location.at_self()) {
if let Err(terr) = self.cx.eq_types(ty, fty, location.at_self()) {
span_mirbug!(
self,
place,
@ -529,13 +526,7 @@ fn sub_types(
})
}
fn eq_types(
&mut self,
_span: Span,
a: Ty<'tcx>,
b: Ty<'tcx>,
locations: Locations,
) -> UnitResult<'tcx> {
fn eq_types(&mut self, a: Ty<'tcx>, b: Ty<'tcx>, locations: Locations) -> UnitResult<'tcx> {
self.fully_perform_op(locations, |this| {
this.infcx
.at(&this.misc(this.last_span), this.param_env)