File tree Expand file tree Collapse file tree 3 files changed +21
-8
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 3 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -568,18 +568,14 @@ impl TypeAliasPart {
568568 if let Some ( ret) = & mut ret {
569569 ret. aliases . push ( type_alias_fqp) ;
570570 } else {
571- let target_did = impl_
572- . inner_impl ( )
573- . trait_
574- . as_ref ( )
575- . map ( |trait_| trait_. def_id ( ) )
576- . or_else ( || impl_. inner_impl ( ) . for_ . def_id ( & cx. shared . cache ) ) ;
571+ let target_trait_did =
572+ impl_. inner_impl ( ) . trait_ . as_ref ( ) . map ( |trait_| trait_. def_id ( ) ) ;
577573 let provided_methods;
578- let assoc_link = if let Some ( target_did ) = target_did {
574+ let assoc_link = if let Some ( target_trait_did ) = target_trait_did {
579575 provided_methods =
580576 impl_. inner_impl ( ) . provided_trait_methods ( cx. tcx ( ) ) ;
581577 AssocItemLink :: GotoSource (
582- ItemId :: DefId ( target_did ) ,
578+ ItemId :: DefId ( target_trait_did ) ,
583579 & provided_methods,
584580 )
585581 } else {
Original file line number Diff line number Diff line change @@ -786,3 +786,13 @@ pub mod tooltips {
786786 Vec :: new ( )
787787 }
788788}
789+
790+ pub mod tyalias {
791+ pub struct X < T > ( pub T ) ;
792+
793+ impl < T : std:: fmt:: Debug > X < T > {
794+ pub fn blob ( & self ) { }
795+ }
796+
797+ pub type Y = X < u8 > ;
798+ }
Original file line number Diff line number Diff line change 1+ // This test ensures that we correctly generate links to methods on type aliases.
2+ go-to: "file://" + |DOC_PATH| + "/test_docs/tyalias/type.Y.html"
3+
4+ // It's generated with JS so we need to wait for it to be done generating.
5+ wait-for: "#implementations"
6+ // We check that it's "#method." and not "#tymethod.".
7+ assert-text: ('#method\.blob a.fn[href="#method.blob"]', "blob")
You can’t perform that action at this time.
0 commit comments