]> git.proxmox.com Git - rustc.git/blame - src/test/ui/generic-associated-types/impl_bounds_ok.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / impl_bounds_ok.rs
CommitLineData
dfeec247
XL
1// check-pass
2
dfeec247
XL
3#![feature(generic_associated_types)]
4#![feature(associated_type_defaults)]
5
6trait Foo {
7 type A<'a> where Self: 'a;
8 type B<'a, 'b> where 'a: 'b;
9 type C where Self: Clone;
10}
11
29967ef6 12#[derive(Clone)]
dfeec247
XL
13struct Fooy;
14
15impl Foo for Fooy {
16 type A<'a> = (&'a ());
29967ef6 17 type B<'a: 'b, 'b> = (&'a(), &'b ());
dfeec247
XL
18 type C = String;
19}
20
21#[derive(Clone)]
22struct Fooer<T>(T);
23
24impl<T> Foo for Fooer<T> {
ee023bcb
FG
25 type A<'x> = (&'x ()) where T: 'x;
26 type B<'u, 'v> = (&'v &'u ()) where 'u: 'v;
27 type C = String where Self: Clone + ToOwned;
dfeec247
XL
28}
29
30fn main() {}