2 use std::ops::DerefMut;
8 pub fn by_ref(&self) {}
9 pub fn by_explicit_ref(self: &Foo) {}
10 pub fn by_mut_ref(&mut self) {}
11 pub fn by_explicit_mut_ref(self: &mut Foo) {}
12 pub fn by_explicit_box(self: Box<Foo>) {}
13 pub fn by_explicit_self_box(self: Box<Self>) {}
14 pub fn static_foo() {}
19 fn deref(&self) -> &Foo { loop {} }
22 impl DerefMut for Bar {
23 fn deref_mut(&mut self) -> &mut Foo { loop {} }
26 // @has issue_35169_2/struct.Bar.html
27 // @has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)'
28 // @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
29 // @has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)'
30 // @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
31 // @has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)'
32 // @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
33 // @has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
34 // @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
35 // @!has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box<Foo>)'
36 // @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
37 // @!has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box<Self>)'
38 // @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
39 // @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()'
40 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'