@@ -12,11 +12,11 @@ use check::regionck::RegionCtxt;
12
12
13
13
use hir:: def_id:: DefId ;
14
14
use rustc:: infer:: { self , InferOk } ;
15
- use rustc:: infer:: outlives:: free_region_map :: FreeRegionMap ;
15
+ use rustc:: infer:: outlives:: env :: OutlivesEnvironment ;
16
16
use rustc:: middle:: region;
17
17
use rustc:: ty:: subst:: { Subst , Substs } ;
18
18
use rustc:: ty:: { self , Ty , TyCtxt } ;
19
- use rustc:: traits:: { self , ObligationCause } ;
19
+ use rustc:: traits:: { self , Reveal , ObligationCause } ;
20
20
use util:: common:: ErrorReported ;
21
21
use util:: nodemap:: FxHashSet ;
22
22
@@ -115,8 +115,18 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>(
115
115
}
116
116
117
117
let region_scope_tree = region:: ScopeTree :: default ( ) ;
118
- let free_regions = FreeRegionMap :: new ( ) ;
119
- infcx. resolve_regions_and_report_errors ( drop_impl_did, & region_scope_tree, & free_regions) ;
118
+
119
+ // NB. It seems a bit... suspicious to use an empty param-env
120
+ // here. The correct thing, I imagine, would be
121
+ // `OutlivesEnvironment::new(impl_param_env)`, which would
122
+ // allow region solving to take any `a: 'b` relations on the
123
+ // impl into account. But I could not create a test case where
124
+ // it did the wrong thing, so I chose to preserve existing
125
+ // behavior, since it ought to be simply more
126
+ // conservative. -nmatsakis
127
+ let outlives_env = OutlivesEnvironment :: new ( ty:: ParamEnv :: empty ( Reveal :: UserFacing ) ) ;
128
+
129
+ infcx. resolve_regions_and_report_errors ( drop_impl_did, & region_scope_tree, & outlives_env) ;
120
130
Ok ( ( ) )
121
131
} )
122
132
}
0 commit comments