]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/gat-in-trait-path.rs
Rollup merge of #82308 - estebank:issue-82290, r=lcnr
[rust.git] / src / test / ui / generic-associated-types / gat-in-trait-path.rs
1 // check-pass
2
3 #![feature(generic_associated_types)]
4   //~^ WARNING: the feature `generic_associated_types` is incomplete
5 #![feature(associated_type_defaults)]
6
7 trait Foo {
8     type A<'a> where Self: 'a;
9 }
10
11 struct Fooy;
12
13 impl Foo for Fooy {
14     type A<'a> = &'a ();
15 }
16
17 #[derive(Clone)]
18 struct Fooer<T>(T);
19
20 impl<T> Foo for Fooer<T> {
21     type A<'x> where T: 'x = &'x ();
22 }
23
24 fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {}
25
26
27 fn main() {
28   let foo = Fooer(5);
29   f(Box::new(foo));
30 }