@@ -38,17 +38,17 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
38
38
{
39
39
// Remove any references to regions; this helps improve caching.
40
40
let trait_ref = self . erase_regions ( & trait_ref) ;
41
+ let param_env = ty:: ParamEnv :: empty ( Reveal :: All ) ;
41
42
42
- self . trans_trait_caches . trait_cache . memoize ( trait_ref, || {
43
+ self . trans_trait_caches . trait_cache . memoize ( ( param_env , trait_ref) , || {
43
44
debug ! ( "trans::fulfill_obligation(trait_ref={:?}, def_id={:?})" ,
44
- trait_ref, trait_ref. def_id( ) ) ;
45
+ ( param_env , trait_ref) , trait_ref. def_id( ) ) ;
45
46
46
47
// Do the initial selection for the obligation. This yields the
47
48
// shallow result we are looking for -- that is, what specific impl.
48
49
self . infer_ctxt ( ) . enter ( |infcx| {
49
50
let mut selcx = SelectionContext :: new ( & infcx) ;
50
51
51
- let param_env = ty:: ParamEnv :: empty ( Reveal :: All ) ;
52
52
let obligation_cause = ObligationCause :: misc ( span,
53
53
ast:: DUMMY_NODE_ID ) ;
54
54
let obligation = Obligation :: new ( obligation_cause,
@@ -167,7 +167,7 @@ pub struct TraitSelectionCache<'tcx> {
167
167
}
168
168
169
169
impl < ' tcx > DepTrackingMapConfig for TraitSelectionCache < ' tcx > {
170
- type Key = ty:: PolyTraitRef < ' tcx > ;
170
+ type Key = ( ty:: ParamEnv < ' tcx > , ty :: PolyTraitRef < ' tcx > ) ;
171
171
type Value = Vtable < ' tcx , ( ) > ;
172
172
fn to_dep_kind ( ) -> DepKind {
173
173
DepKind :: TraitSelect
0 commit comments