@@ -1985,7 +1985,7 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
1985
1985
{
1986
1986
let mut derefs = FxHashSet :: default ( ) ;
1987
1987
derefs. insert ( did) ;
1988
- sidebar_deref_methods ( cx, out, impl_, v, & mut derefs) ;
1988
+ sidebar_deref_methods ( cx, out, impl_, v, & mut derefs, & mut used_links ) ;
1989
1989
}
1990
1990
1991
1991
let format_impls = |impls : Vec < & Impl > , id_map : & mut IdMap | {
@@ -2057,6 +2057,7 @@ fn sidebar_deref_methods(
2057
2057
impl_ : & Impl ,
2058
2058
v : & [ Impl ] ,
2059
2059
derefs : & mut FxHashSet < DefId > ,
2060
+ used_links : & mut FxHashSet < String > ,
2060
2061
) {
2061
2062
let c = cx. cache ( ) ;
2062
2063
@@ -2089,13 +2090,10 @@ fn sidebar_deref_methods(
2089
2090
. and_then ( |did| c. impls . get ( & did) ) ;
2090
2091
if let Some ( impls) = inner_impl {
2091
2092
debug ! ( "found inner_impl: {:?}" , impls) ;
2092
- let mut used_links = FxHashSet :: default ( ) ;
2093
2093
let mut ret = impls
2094
2094
. iter ( )
2095
2095
. filter ( |i| i. inner_impl ( ) . trait_ . is_none ( ) )
2096
- . flat_map ( |i| {
2097
- get_methods ( i. inner_impl ( ) , true , & mut used_links, deref_mut, cx. tcx ( ) )
2098
- } )
2096
+ . flat_map ( |i| get_methods ( i. inner_impl ( ) , true , used_links, deref_mut, cx. tcx ( ) ) )
2099
2097
. collect :: < Vec < _ > > ( ) ;
2100
2098
if !ret. is_empty ( ) {
2101
2099
let id = if let Some ( target_def_id) = real_target. def_id ( c) {
@@ -2124,7 +2122,14 @@ fn sidebar_deref_methods(
2124
2122
. map ( |t| Some ( t. def_id ( ) ) == cx. tcx ( ) . lang_items ( ) . deref_trait ( ) )
2125
2123
. unwrap_or ( false )
2126
2124
} ) {
2127
- sidebar_deref_methods ( cx, out, target_deref_impl, target_impls, derefs) ;
2125
+ sidebar_deref_methods (
2126
+ cx,
2127
+ out,
2128
+ target_deref_impl,
2129
+ target_impls,
2130
+ derefs,
2131
+ used_links,
2132
+ ) ;
2128
2133
}
2129
2134
}
2130
2135
}
0 commit comments