1 #![feature(generic_associated_types)]
2 #![feature(associated_type_defaults)]
3 
4 trait Foo {
5     type A<'a> where Self: 'a;
6 }
7 
8 struct Fooy;
9 
10 impl Foo for Fooy {
11     type A<'a> = &'a ();
12 }
13 
14 #[derive(Clone)]
15 struct Fooer<T>(T);
16 
17 impl<T> Foo for Fooer<T> {
18     type A<'x> where T: 'x = &'x ();
19 }
20 
f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>)21 fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {}
22 //~^ the trait `Foo` cannot be made into an object
23 
24 
main()25 fn main() {
26   let foo = Fooer(5);
27   f(Box::new(foo));
28 }
29