]>
Commit | Line | Data |
---|---|---|
5869c6ff | 1 | #![feature(generic_associated_types)] |
5869c6ff XL |
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 | ||
21 | fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {} | |
cdc7bbd5 | 22 | //~^ the trait `Foo` cannot be made into an object |
5869c6ff XL |
23 | |
24 | ||
25 | fn main() { | |
26 | let foo = Fooer(5); | |
27 | f(Box::new(foo)); | |
28 | } |