]> git.proxmox.com Git - rustc.git/blob - tests/rustdoc/auxiliary/extern-impl-trait.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 }