]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/auxiliary/extern-impl-trait.rs
Rollup merge of #84464 - jyn514:type-kind, r=CraftSpider
[rust.git] / src / test / rustdoc / auxiliary / extern-impl-trait.rs
1 pub trait Foo {
2     type Associated;
3 }
4
5 pub struct X;
6 pub struct Y;
7
8
9 impl Foo for X {
10     type Associated = ();
11 }
12
13 impl Foo for Y {
14     type Associated = ();
15 }
16
17 impl X {
18     pub fn returns_sized<'a>(&'a self) -> impl Foo<Associated=()> + 'a {
19         X
20     }
21 }
22
23 impl Y {
24     pub fn returns_unsized<'a>(&'a self) -> Box<impl ?Sized + Foo<Associated=()> + 'a> {
25         Box::new(X)
26     }
27 }