@@ -9,7 +9,7 @@ use rustc_data_structures::frozen::Frozen;
99use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
1010use rustc_errors:: struct_span_err;
1111use rustc_hir as hir;
12- use rustc_hir:: def_id:: DefId ;
12+ use rustc_hir:: def_id:: { DefId , LocalDefId } ;
1313use rustc_index:: vec:: { Idx , IndexVec } ;
1414use rustc_infer:: infer:: canonical:: QueryRegionConstraints ;
1515use rustc_infer:: infer:: outlives:: env:: RegionBoundPairs ;
@@ -2569,7 +2569,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25692569 // clauses on the struct.
25702570 AggregateKind :: Closure ( def_id, substs)
25712571 | AggregateKind :: Generator ( def_id, substs, _) => {
2572- self . prove_closure_bounds ( tcx, * def_id, substs, location)
2572+ self . prove_closure_bounds ( tcx, def_id. expect_local ( ) , substs, location)
25732573 }
25742574
25752575 AggregateKind :: Array ( _) | AggregateKind :: Tuple => ty:: InstantiatedPredicates :: empty ( ) ,
@@ -2584,14 +2584,18 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25842584 fn prove_closure_bounds (
25852585 & mut self ,
25862586 tcx : TyCtxt < ' tcx > ,
2587- def_id : DefId ,
2587+ def_id : LocalDefId ,
25882588 substs : SubstsRef < ' tcx > ,
25892589 location : Location ,
25902590 ) -> ty:: InstantiatedPredicates < ' tcx > {
25912591 if let Some ( ref closure_region_requirements) = tcx. mir_borrowck ( def_id) . closure_requirements
25922592 {
25932593 let closure_constraints = QueryRegionConstraints {
2594- outlives : closure_region_requirements. apply_requirements ( tcx, def_id, substs) ,
2594+ outlives : closure_region_requirements. apply_requirements (
2595+ tcx,
2596+ def_id. to_def_id ( ) ,
2597+ substs,
2598+ ) ,
25952599
25962600 // Presently, closures never propagate member
25972601 // constraints to their parents -- they are enforced
0 commit comments