]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/issue-19190.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / rustdoc / issue-19190.rs
1 // compile-flags:-Z unstable-options --generate-redirect-pages
2
3 use std::ops::Deref;
4
5 pub struct Foo;
6 pub struct Bar;
7
8 impl Foo {
9     pub fn foo(&self) {}
10     pub fn static_foo() {}
11 }
12
13 impl Deref for Bar {
14     type Target = Foo;
15     fn deref(&self) -> &Foo { loop {} }
16 }
17
18 // @has issue_19190/Bar.t.html
19 // @has issue_19190/struct.Bar.html
20 // @has - '//*[@id="foo.v"]' 'fn foo(&self)'
21 // @has - '//*[@id="method.foo"]' 'fn foo(&self)'
22 // @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
23 // @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'