@@ -118,12 +118,12 @@ impl<'a, 'b, 'tcx> Instance<'tcx> {
118
118
119
119
/// The point where linking happens. Resolve a (def_id, substs)
120
120
/// pair to an instance.
121
- pub fn resolve ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId , substs : & ' tcx Substs < ' tcx > ) -> Option < Instance < ' tcx > > {
121
+ pub fn resolve ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , param_env : ty :: ParamEnv < ' tcx > , def_id : DefId , substs : & ' tcx Substs < ' tcx > ) -> Option < Instance < ' tcx > > {
122
122
debug ! ( "resolve(def_id={:?}, substs={:?})" , def_id, substs) ;
123
123
let result = if let Some ( trait_def_id) = tcx. trait_of_item ( def_id) {
124
124
debug ! ( " => associated item, attempting to find impl" ) ;
125
125
let item = tcx. associated_item ( def_id) ;
126
- resolve_associated_item ( tcx, & item, trait_def_id, substs)
126
+ resolve_associated_item ( tcx, & item, param_env , trait_def_id, substs)
127
127
} else {
128
128
let ty = tcx. type_of ( def_id) ;
129
129
let item_type = tcx. trans_apply_param_substs ( substs, & ty) ;
@@ -184,6 +184,7 @@ fn resolve_closure<'a, 'tcx>(
184
184
fn resolve_associated_item < ' a , ' tcx > (
185
185
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
186
186
trait_item : & ty:: AssociatedItem ,
187
+ param_env : ty:: ParamEnv < ' tcx > ,
187
188
trait_id : DefId ,
188
189
rcvr_substs : & ' tcx Substs < ' tcx >
189
190
) -> Option < Instance < ' tcx > > {
@@ -194,7 +195,7 @@ fn resolve_associated_item<'a, 'tcx>(
194
195
def_id, trait_id, rcvr_substs) ;
195
196
196
197
let trait_ref = ty:: TraitRef :: from_method ( tcx, trait_id, rcvr_substs) ;
197
- let vtbl = tcx. trans_fulfill_obligation ( DUMMY_SP , ty:: Binder ( trait_ref) ) ;
198
+ let vtbl = tcx. trans_fulfill_obligation ( DUMMY_SP , param_env , ty:: Binder ( trait_ref) ) ;
198
199
199
200
// Now that we know which impl is being used, we can dispatch to
200
201
// the actual function:
0 commit comments