@@ -6,7 +6,7 @@ use rustc_span::DUMMY_SP;
66use  rustc_span:: def_id:: DefId ; 
77use  rustc_trait_selection:: traits; 
88use  thin_vec:: ThinVec ; 
9- use  tracing:: { debug,  instrument,  trace } ; 
9+ use  tracing:: { debug,  instrument} ; 
1010
1111use  crate :: clean; 
1212use  crate :: clean:: { 
@@ -22,6 +22,9 @@ pub(crate) fn synthesize_blanket_impls(
2222    let  tcx = cx. tcx ; 
2323    let  ty = tcx. type_of ( item_def_id) ; 
2424
25+     let  infcx =
26+         tcx. infer_ctxt ( ) . with_next_trait_solver ( true ) . build ( TypingMode :: non_body_analysis ( ) ) ; 
27+ 
2528    let  mut  blanket_impls = Vec :: new ( ) ; 
2629    for  trait_def_id in  tcx. visible_traits ( )  { 
2730        if  !cx. cache . effective_visibilities . is_reachable ( tcx,  trait_def_id) 
@@ -32,16 +35,10 @@ pub(crate) fn synthesize_blanket_impls(
3235        // NOTE: doesn't use `for_each_relevant_impl` to avoid looking at anything besides blanket impls 
3336        let  trait_impls = tcx. trait_impls_of ( trait_def_id) ; 
3437        for  & impl_def_id in  trait_impls. blanket_impls ( )  { 
35-             trace ! ( "considering impl `{impl_def_id:?}` for trait `{trait_def_id:?}`" ) ; 
36- 
3738            let  trait_ref = tcx. impl_trait_ref ( impl_def_id) . unwrap ( ) ; 
38-             if  !matches ! ( trait_ref. skip_binder( ) . self_ty( ) . kind( ) ,  ty:: Param ( _) )  { 
39-                 continue ; 
40-             } 
41-             let  infcx = tcx
42-                 . infer_ctxt ( ) 
43-                 . with_next_trait_solver ( true ) 
44-                 . build ( TypingMode :: non_body_analysis ( ) ) ; 
39+ 
40+             let  ty:: Param ( _)  = trait_ref. skip_binder ( ) . self_ty ( ) . kind ( )  else  {  continue  } ; 
41+ 
4542            let  ocx = traits:: ObligationCtxt :: new ( & infcx) ; 
4643
4744            let  args = infcx. fresh_args_for_item ( DUMMY_SP ,  item_def_id) ; 
0 commit comments