File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ crate_name = "foo" ]
2
+
3
+ // test for https://github.com/rust-lang/rust/issues/24686
4
+ use std:: ops:: Deref ;
5
+
6
+ pub struct Foo < T > ( T ) ;
7
+ impl Foo < i32 > {
8
+ pub fn get_i32 ( & self ) -> i32 { self . 0 }
9
+ }
10
+ impl Foo < u32 > {
11
+ pub fn get_u32 ( & self ) -> u32 { self . 0 }
12
+ }
13
+
14
+ // Note that the same href is used both on the method itself,
15
+ // and on the sidebar items.
16
+ //@ has foo/struct.Bar.html
17
+ //@ has - '//a[@href="#method.get_i32"]' 'get_i32'
18
+ //@ !has - '//a[@href="#method.get_u32"]' 'get_u32'
19
+ //@ count - '//ul[@class="block deref-methods"]//a' 1
20
+ //@ count - '//a[@href="#method.get_i32"]' 2
21
+ pub struct Bar ( Foo < i32 > ) ;
22
+ impl Deref for Bar {
23
+ type Target = Foo < i32 > ;
24
+ fn deref ( & self ) -> & Foo < i32 > {
25
+ & self . 0
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments