@@ -85,6 +85,8 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
8585 source_substs : & ' tcx Substs < ' tcx > ,
8686 target_node : specialization_graph:: Node )
8787 -> & ' tcx Substs < ' tcx > {
88+ debug ! ( "translate_substs({:?}, {:?}, {:?}, {:?})" ,
89+ param_env, source_impl, source_substs, target_node) ;
8890 let source_trait_ref = infcx. tcx
8991 . impl_trait_ref ( source_impl)
9092 . unwrap ( )
@@ -119,10 +121,13 @@ pub fn translate_substs<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
119121/// whichever applies.
120122pub fn find_associated_item < ' a , ' tcx > (
121123 tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
124+ param_env : ty:: ParamEnv < ' tcx > ,
122125 item : & ty:: AssociatedItem ,
123126 substs : & ' tcx Substs < ' tcx > ,
124127 impl_data : & super :: VtableImplData < ' tcx , ( ) > ,
125128) -> ( DefId , & ' tcx Substs < ' tcx > ) {
129+ debug ! ( "find_associated_item({:?}, {:?}, {:?}, {:?})" ,
130+ param_env, item, substs, impl_data) ;
126131 assert ! ( !substs. needs_infer( ) ) ;
127132
128133 let trait_def_id = tcx. trait_id_of_impl ( impl_data. impl_def_id ) . unwrap ( ) ;
@@ -132,7 +137,7 @@ pub fn find_associated_item<'a, 'tcx>(
132137 match ancestors. defs ( tcx, item. ident , item. kind , trait_def_id) . next ( ) {
133138 Some ( node_item) => {
134139 let substs = tcx. infer_ctxt ( ) . enter ( |infcx| {
135- let param_env = ty :: ParamEnv :: reveal_all ( ) ;
140+ let param_env = param_env . with_reveal_all ( ) ;
136141 let substs = substs. rebase_onto ( tcx, trait_def_id, impl_data. substs ) ;
137142 let substs = translate_substs ( & infcx, param_env, impl_data. impl_def_id ,
138143 substs, node_item. node ) ;
@@ -219,12 +224,17 @@ fn fulfill_implication<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
219224 source_trait_ref : ty:: TraitRef < ' tcx > ,
220225 target_impl : DefId )
221226 -> Result < & ' tcx Substs < ' tcx > , ( ) > {
227+ debug ! ( "fulfill_implication({:?}, trait_ref={:?} |- {:?} applies)" ,
228+ param_env, source_trait_ref, target_impl) ;
229+
222230 let selcx = & mut SelectionContext :: new ( & infcx) ;
223231 let target_substs = infcx. fresh_substs_for_item ( DUMMY_SP , target_impl) ;
224232 let ( target_trait_ref, mut obligations) = impl_trait_ref_and_oblig ( selcx,
225233 param_env,
226234 target_impl,
227235 target_substs) ;
236+ debug ! ( "fulfill_implication: target_trait_ref={:?}, obligations={:?}" ,
237+ target_trait_ref, obligations) ;
228238
229239 // do the impls unify? If not, no specialization.
230240 match infcx. at ( & ObligationCause :: dummy ( ) , param_env)
0 commit comments