@@ -188,14 +188,14 @@ impl<'tcx> InferCtxt<'tcx> {
188188 let InferOk { value : result_args, obligations } =
189189 self . query_response_instantiation ( cause, param_env, original_values, query_response) ?;
190190
191- for ( constraint, _category) in & query_response. value . region_constraints . constraints {
191+ for ( constraint, _category, vis ) in & query_response. value . region_constraints . constraints {
192192 let constraint = instantiate_value ( self . tcx , & result_args, * constraint) ;
193193 match constraint {
194194 ty:: RegionConstraint :: Outlives ( predicate) => {
195- self . register_outlives_constraint ( predicate, cause) ;
195+ self . register_outlives_constraint ( predicate, * vis , cause) ;
196196 }
197197 ty:: RegionConstraint :: Eq ( predicate) => {
198- self . register_region_eq_constraint ( predicate, cause) ;
198+ self . register_region_eq_constraint ( predicate, * vis , cause) ;
199199 }
200200 }
201201 }
@@ -288,6 +288,7 @@ impl<'tcx> InferCtxt<'tcx> {
288288 output_query_region_constraints. constraints . push ( (
289289 ty:: RegionEqPredicate ( v_o. into ( ) , v_r) . into ( ) ,
290290 constraint_category,
291+ ty:: VisibleForLeakcheck :: Yes ,
291292 ) ) ;
292293 }
293294 }
@@ -586,6 +587,7 @@ impl<'tcx> InferCtxt<'tcx> {
586587 SubregionOrigin :: RelateRegionParamBound ( cause. span , None ) ,
587588 v1,
588589 v2,
590+ ty:: VisibleForLeakcheck :: Yes ,
589591 ) ;
590592 }
591593 ( GenericArgKind :: Const ( v1) , GenericArgKind :: Const ( v2) ) => {
@@ -623,20 +625,23 @@ pub fn make_query_region_constraints<'tcx>(
623625 | ConstraintKind :: RegSubReg => {
624626 // Swap regions because we are going from sub (<=) to outlives (>=).
625627 let constraint = ty:: OutlivesPredicate ( c. sup . into ( ) , c. sub ) . into ( ) ;
626- ( constraint, origin. to_constraint_category ( ) )
628+ ( constraint, origin. to_constraint_category ( ) , c . visible_for_leakcheck )
627629 }
628630
629631 ConstraintKind :: VarEqVar | ConstraintKind :: VarEqReg | ConstraintKind :: RegEqReg => {
630632 let constraint = ty:: RegionEqPredicate ( c. sup , c. sub ) . into ( ) ;
631- ( constraint, origin. to_constraint_category ( ) )
633+ ( constraint, origin. to_constraint_category ( ) , c . visible_for_leakcheck )
632634 }
633635 } )
634- . chain ( outlives_obligations. into_iter ( ) . map ( |obl| {
635- (
636- ty:: OutlivesPredicate ( obl. sup_type . into ( ) , obl. sub_region ) . into ( ) ,
637- obl. origin . to_constraint_category ( ) ,
638- )
639- } ) )
636+ . chain ( outlives_obligations. into_iter ( ) . map (
637+ |TypeOutlivesConstraint { sub_region, sup_type, origin, visible_for_leakcheck } | {
638+ (
639+ ty:: OutlivesPredicate ( sup_type. into ( ) , sub_region) . into ( ) ,
640+ origin. to_constraint_category ( ) ,
641+ visible_for_leakcheck,
642+ )
643+ } ,
644+ ) )
640645 . collect ( ) ;
641646
642647 QueryRegionConstraints { constraints, assumptions }
0 commit comments