cosmetic changes

This commit is contained in:
Ali MJ Al-Nasrawy 2022-08-03 12:46:04 +03:00
parent 28f24ebe9f
commit 78adc0139c
2 changed files with 11 additions and 5 deletions

View file

@ -2635,10 +2635,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
if let Err(_) = self.eq_substs(
typeck_root_substs,
parent_substs,
Locations::Single(location),
location.to_locations(),
ConstraintCategory::BoringNoLocation,
) {
bug!("we shouldn't error, this should only impose region constraints");
span_mirbug!(
self,
def_id,
"could not relate closure to parent {:?} != {:?}",
typeck_root_substs,
parent_substs
);
}
tcx.predicates_of(def_id).instantiate(tcx, substs)

View file

@ -47,12 +47,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
locations: Locations,
category: ConstraintCategory<'tcx>,
) -> Fallible<()> {
let mut relation = TypeRelating::new(
TypeRelating::new(
self.infcx,
NllTypeRelatingDelegate::new(self, locations, category, UniverseInfo::other()),
ty::Variance::Invariant,
);
ty::relate::relate_substs(&mut relation, a, b)?;
)
.relate(a, b)?;
Ok(())
}
}