]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/impl-everywhere.rs
Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-Simulacrum
[rust.git] / src / test / rustdoc / impl-everywhere.rs
1 #![crate_name = "foo"]
2
3 pub trait Foo {}
4 pub trait Foo2 {}
5
6 pub struct Bar;
7
8 impl Foo for Bar {}
9 impl Foo2 for Bar {}
10
11 // @!has foo/fn.foo.html '//section[@id="main"]//pre' "x: &\'x impl Foo"
12 // @!has foo/fn.foo.html '//section[@id="main"]//pre' "-> &\'x impl Foo {"
13 pub fn foo<'x>(x: &'x impl Foo) -> &'x impl Foo {
14     x
15 }
16
17 // @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &\'x impl Foo"
18 // @!has foo/fn.foo2.html '//section[@id="main"]//pre' '-> impl Foo2 {'
19 pub fn foo2<'x>(_x: &'x impl Foo) -> impl Foo2 {
20     Bar
21 }
22
23 // @!has foo/fn.foo_foo.html '//section[@id="main"]//pre' '-> impl Foo + Foo2 {'
24 pub fn foo_foo() -> impl Foo + Foo2 {
25     Bar
26 }
27
28 // @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &'x (impl Foo + Foo2)"
29 pub fn foo_foo_foo<'x>(_x: &'x (impl Foo + Foo2)) {
30 }