We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57e88ab commit 047a70fCopy full SHA for 047a70f
tests/rustdoc/deref/deref-methods-24686-target.rs
@@ -0,0 +1,27 @@
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
0 commit comments