]> git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/issue-35169.rs
New upstream version 1.54.0+dfsg1
[rustc.git] / src / test / rustdoc / issue-35169.rs
1 use std::ops::Deref;
2
3 pub struct Foo;
4 pub struct Bar;
5
6 impl Foo {
7 pub fn by_ref(&self) {}
8 pub fn by_explicit_ref(self: &Foo) {}
9 pub fn by_mut_ref(&mut self) {}
10 pub fn by_explicit_mut_ref(self: &mut Foo) {}
11 pub fn by_explicit_box(self: Box<Foo>) {}
12 pub fn by_explicit_self_box(self: Box<Self>) {}
13 pub fn static_foo() {}
14 }
15
16 impl Deref for Bar {
17 type Target = Foo;
18 fn deref(&self) -> &Foo { loop {} }
19 }
20
21 // @has issue_35169/struct.Bar.html
22 // @has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)'
23 // @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
24 // @has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)'
25 // @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
26 // @!has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)'
27 // @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
28 // @!has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
29 // @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
30 // @!has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box<Foo>)'
31 // @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
32 // @!has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box<Self>)'
33 // @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
34 // @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
35 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'