]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/issue-35169.rs
Auto merge of #41157 - aidanhs:aphs-debug-appveyor-cache, r=TimNN
[rust.git] / src / test / rustdoc / issue-35169.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 use std::ops::Deref;
12
13 pub struct Foo;
14 pub struct Bar;
15
16 impl Foo {
17     pub fn by_ref(&self) {}
18     pub fn by_explicit_ref(self: &Foo) {}
19     pub fn by_mut_ref(&mut self) {}
20     pub fn by_explicit_mut_ref(self: &mut Foo) {}
21     pub fn static_foo() {}
22 }
23
24 impl Deref for Bar {
25     type Target = Foo;
26     fn deref(&self) -> &Foo { loop {} }
27 }
28
29 // @has issue_35169/Bar.t.html
30 // @has issue_35169/struct.Bar.html
31 // @has - '//*[@id="by_ref.v"]' 'fn by_ref(&self)'
32 // @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)'
33 // @has - '//*[@id="by_explicit_ref.v"]' 'fn by_explicit_ref(self: &Foo)'
34 // @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)'
35 // @!has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
36 // @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
37 // @!has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
38 // @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
39 // @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
40 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'