@@ -6,7 +6,7 @@ use rustc_span::DUMMY_SP;
6
6
use rustc_span:: def_id:: DefId ;
7
7
use rustc_trait_selection:: traits;
8
8
use thin_vec:: ThinVec ;
9
- use tracing:: { debug, instrument, trace } ;
9
+ use tracing:: { debug, instrument} ;
10
10
11
11
use crate :: clean;
12
12
use crate :: clean:: {
@@ -22,6 +22,9 @@ pub(crate) fn synthesize_blanket_impls(
22
22
let tcx = cx. tcx ;
23
23
let ty = tcx. type_of ( item_def_id) ;
24
24
25
+ let infcx =
26
+ tcx. infer_ctxt ( ) . with_next_trait_solver ( true ) . build ( TypingMode :: non_body_analysis ( ) ) ;
27
+
25
28
let mut blanket_impls = Vec :: new ( ) ;
26
29
for trait_def_id in tcx. visible_traits ( ) {
27
30
if !cx. cache . effective_visibilities . is_reachable ( tcx, trait_def_id)
@@ -32,16 +35,10 @@ pub(crate) fn synthesize_blanket_impls(
32
35
// NOTE: doesn't use `for_each_relevant_impl` to avoid looking at anything besides blanket impls
33
36
let trait_impls = tcx. trait_impls_of ( trait_def_id) ;
34
37
for & impl_def_id in trait_impls. blanket_impls ( ) {
35
- trace ! ( "considering impl `{impl_def_id:?}` for trait `{trait_def_id:?}`" ) ;
36
-
37
38
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
+
45
42
let ocx = traits:: ObligationCtxt :: new ( & infcx) ;
46
43
47
44
let args = infcx. fresh_args_for_item ( DUMMY_SP , item_def_id) ;
0 commit comments