@@ -587,6 +587,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
587
587
// modify their locations.
588
588
let all_facts = & mut None ;
589
589
let mut constraints = Default :: default ( ) ;
590
+ let mut type_tests = Default :: default ( ) ;
590
591
let mut closure_bounds = Default :: default ( ) ;
591
592
let mut liveness_constraints =
592
593
LivenessValues :: new ( Rc :: new ( RegionValueElements :: new ( & promoted_body) ) ) ;
@@ -598,6 +599,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
598
599
& mut this. cx . borrowck_context . constraints . outlives_constraints ,
599
600
& mut constraints,
600
601
) ;
602
+ mem:: swap ( & mut this. cx . borrowck_context . constraints . type_tests , & mut type_tests) ;
601
603
mem:: swap (
602
604
& mut this. cx . borrowck_context . constraints . closure_bounds_mapping ,
603
605
& mut closure_bounds,
@@ -622,6 +624,13 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
622
624
swap_constraints ( self ) ;
623
625
624
626
let locations = location. to_locations ( ) ;
627
+
628
+ // Use location of promoted const in collected constraints
629
+ for type_test in type_tests. iter ( ) {
630
+ let mut type_test = type_test. clone ( ) ;
631
+ type_test. locations = locations;
632
+ self . cx . borrowck_context . constraints . type_tests . push ( type_test)
633
+ }
625
634
for constraint in constraints. outlives ( ) . iter ( ) {
626
635
let mut constraint = constraint. clone ( ) ;
627
636
constraint. locations = locations;
0 commit comments