File tree 2 files changed +25
-11
lines changed
2 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -4126,14 +4126,14 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
4126
4126
. filter ( |i| i. inner_impl ( ) . trait_ . is_some ( ) )
4127
4127
. find ( |i| i. inner_impl ( ) . trait_ . def_id ( ) == c. deref_trait_did )
4128
4128
{
4129
- if let Some ( target) = impl_
4129
+ if let Some ( ( target, real_target ) ) = impl_
4130
4130
. inner_impl ( )
4131
4131
. items
4132
4132
. iter ( )
4133
4133
. filter_map ( |item| match item. inner {
4134
4134
clean:: TypedefItem ( ref t, true ) => Some ( match * t {
4135
- clean:: Typedef { item_type : Some ( ref type_) , .. } => type_,
4136
- _ => & t. type_ ,
4135
+ clean:: Typedef { item_type : Some ( ref type_) , .. } => ( type_, & t . type_ ) ,
4136
+ _ => ( & t. type_ , & t . type_ ) ,
4137
4137
} ) ,
4138
4138
_ => None ,
4139
4139
} )
@@ -4153,7 +4153,7 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
4153
4153
"{:#}" ,
4154
4154
impl_. inner_impl( ) . trait_. as_ref( ) . unwrap( ) . print( )
4155
4155
) ) ,
4156
- Escape ( & format!( "{:#}" , target . print( ) ) )
4156
+ Escape ( & format!( "{:#}" , real_target . print( ) ) )
4157
4157
) ) ;
4158
4158
out. push_str ( "</a>" ) ;
4159
4159
let mut ret = impls
Original file line number Diff line number Diff line change 1
1
#![ crate_name = "foo" ]
2
2
3
3
// @has 'foo/struct.Bar.html'
4
- // @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooB>'
5
- // @has '-' '//*[@class="impl-items"]//*[@id="method.happy"]' 'pub fn happy(&self)'
6
- // @has '-' '//*[@class="sidebar-title"]' 'Methods from Deref<Target=FooB>'
7
- // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.happy"]' 'happy'
4
+ // @has '-' '//*[@id="deref-methods"]' 'Methods from Deref<Target = FooC>'
5
+ // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)'
6
+ // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)'
7
+ // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)'
8
+ // @has '-' '//*[@class="sidebar-title"]' 'Methods from Deref<Target=FooC>'
9
+ // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_a"]' 'foo_a'
10
+ // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_b"]' 'foo_b'
11
+ // @has '-' '//*[@class="sidebar-links"]/a[@href="#method.foo_c"]' 'foo_c'
12
+
8
13
pub struct FooA ;
9
14
pub type FooB = FooA ;
15
+ pub type FooC = FooB ;
10
16
11
17
impl FooA {
12
- pub fn happy ( & self ) { }
18
+ pub fn foo_a ( & self ) { }
19
+ }
20
+
21
+ impl FooB {
22
+ pub fn foo_b ( & self ) { }
23
+ }
24
+
25
+ impl FooC {
26
+ pub fn foo_c ( & self ) { }
13
27
}
14
28
15
29
pub struct Bar ;
16
30
impl std:: ops:: Deref for Bar {
17
- type Target = FooB ;
18
- fn deref ( & self ) -> & FooB { unimplemented ! ( ) }
31
+ type Target = FooC ;
32
+ fn deref ( & self ) -> & Self :: Target { unimplemented ! ( ) }
19
33
}
You can’t perform that action at this time.
0 commit comments