@@ -623,42 +623,46 @@ impl TypeAliasPart {
623623 for & ( type_alias_fqp, type_alias_item) in type_aliases {
624624 cx. id_map . borrow_mut ( ) . clear ( ) ;
625625 cx. deref_id_map . borrow_mut ( ) . clear ( ) ;
626- let target_did = impl_
627- . inner_impl ( )
628- . trait_
629- . as_ref ( )
630- . map ( |trait_| trait_. def_id ( ) )
631- . or_else ( || impl_. inner_impl ( ) . for_ . def_id ( & cx. shared . cache ) ) ;
632- let provided_methods;
633- let assoc_link = if let Some ( target_did) = target_did {
634- provided_methods = impl_. inner_impl ( ) . provided_trait_methods ( cx. tcx ( ) ) ;
635- AssocItemLink :: GotoSource ( ItemId :: DefId ( target_did) , & provided_methods)
636- } else {
637- AssocItemLink :: Anchor ( None )
638- } ;
639- let text = super :: render_impl (
640- cx,
641- impl_,
642- type_alias_item,
643- assoc_link,
644- RenderMode :: Normal ,
645- None ,
646- & [ ] ,
647- ImplRenderingParameters {
648- show_def_docs : true ,
649- show_default_items : true ,
650- show_non_assoc_items : true ,
651- toggle_open_by_default : true ,
652- } ,
653- )
654- . to_string ( ) ;
655626 let type_alias_fqp = ( * type_alias_fqp) . iter ( ) . join ( "::" ) ;
656- if Some ( & text ) == ret. last ( ) . map ( |s : & AliasSerializableImpl | & s. text ) {
627+ if ret. last ( ) . map ( |s : & AliasSerializableImpl | & s. text ) . is_some ( ) {
657628 ret. last_mut ( )
658629 . expect ( "already established that ret.last() is Some()" )
659630 . aliases
660631 . push ( type_alias_fqp) ;
661632 } else {
633+ let target_did = impl_
634+ . inner_impl ( )
635+ . trait_
636+ . as_ref ( )
637+ . map ( |trait_| trait_. def_id ( ) )
638+ . or_else ( || impl_. inner_impl ( ) . for_ . def_id ( & cx. shared . cache ) ) ;
639+ let provided_methods;
640+ let assoc_link = if let Some ( target_did) = target_did {
641+ provided_methods =
642+ impl_. inner_impl ( ) . provided_trait_methods ( cx. tcx ( ) ) ;
643+ AssocItemLink :: GotoSource (
644+ ItemId :: DefId ( target_did) ,
645+ & provided_methods,
646+ )
647+ } else {
648+ AssocItemLink :: Anchor ( None )
649+ } ;
650+ let text = super :: render_impl (
651+ cx,
652+ impl_,
653+ type_alias_item,
654+ assoc_link,
655+ RenderMode :: Normal ,
656+ None ,
657+ & [ ] ,
658+ ImplRenderingParameters {
659+ show_def_docs : true ,
660+ show_default_items : true ,
661+ show_non_assoc_items : true ,
662+ toggle_open_by_default : true ,
663+ } ,
664+ )
665+ . to_string ( ) ;
662666 ret. push ( AliasSerializableImpl {
663667 text,
664668 trait_ : trait_. clone ( ) ,
0 commit comments