Skip to content

Commit 78adc01

Browse files
committed
cosmetic changes
1 parent 28f24eb commit 78adc01

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -2635,10 +2635,16 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
26352635
if let Err(_) = self.eq_substs(
26362636
typeck_root_substs,
26372637
parent_substs,
2638-
Locations::Single(location),
2638+
location.to_locations(),
26392639
ConstraintCategory::BoringNoLocation,
26402640
) {
2641-
bug!("we shouldn't error, this should only impose region constraints");
2641+
span_mirbug!(
2642+
self,
2643+
def_id,
2644+
"could not relate closure to parent {:?} != {:?}",
2645+
typeck_root_substs,
2646+
parent_substs
2647+
);
26422648
}
26432649

26442650
tcx.predicates_of(def_id).instantiate(tcx, substs)

compiler/rustc_borrowck/src/type_check/relate_tys.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
4747
locations: Locations,
4848
category: ConstraintCategory<'tcx>,
4949
) -> Fallible<()> {
50-
let mut relation = TypeRelating::new(
50+
TypeRelating::new(
5151
self.infcx,
5252
NllTypeRelatingDelegate::new(self, locations, category, UniverseInfo::other()),
5353
ty::Variance::Invariant,
54-
);
55-
ty::relate::relate_substs(&mut relation, a, b)?;
54+
)
55+
.relate(a, b)?;
5656
Ok(())
5757
}
5858
}

0 commit comments

Comments
 (0)