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