@@ -1973,21 +1973,18 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
1973
1973
let mut ret = impls
1974
1974
. iter ( )
1975
1975
. filter_map ( |it| {
1976
- if let Some ( ref i) = it. inner_impl ( ) . trait_ {
1977
- let i_display = format ! ( "{:#}" , i. print( cx) ) ;
1978
- let out = Escape ( & i_display) ;
1979
- let encoded =
1980
- id_map. derive ( small_url_encode ( format ! ( "impl-{:#}" , i. print( cx) ) ) ) ;
1981
- let prefix = match it. inner_impl ( ) . polarity {
1982
- ty:: ImplPolarity :: Positive | ty:: ImplPolarity :: Reservation => "" ,
1983
- ty:: ImplPolarity :: Negative => "!" ,
1984
- } ;
1985
- let generated =
1986
- format ! ( "<a href=\" #{}\" >{}{}</a>" , encoded, prefix, out) ;
1987
- if links. insert ( generated. clone ( ) ) { Some ( generated) } else { None }
1988
- } else {
1989
- None
1990
- }
1976
+ let trait_ = it. inner_impl ( ) . trait_ . as_ref ( ) ?;
1977
+ let encoded =
1978
+ id_map. derive ( get_id_for_impl ( & it. inner_impl ( ) . for_ , Some ( trait_) , cx) ) ;
1979
+
1980
+ let i_display = format ! ( "{:#}" , trait_. print( cx) ) ;
1981
+ let out = Escape ( & i_display) ;
1982
+ let prefix = match it. inner_impl ( ) . polarity {
1983
+ ty:: ImplPolarity :: Positive | ty:: ImplPolarity :: Reservation => "" ,
1984
+ ty:: ImplPolarity :: Negative => "!" ,
1985
+ } ;
1986
+ let generated = format ! ( "<a href=\" #{}\" >{}{}</a>" , encoded, prefix, out) ;
1987
+ if links. insert ( generated. clone ( ) ) { Some ( generated) } else { None }
1991
1988
} )
1992
1989
. collect :: < Vec < String > > ( ) ;
1993
1990
ret. sort ( ) ;
0 commit comments