]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/gat-in-trait-path.rs
Auto merge of #85305 - MarcusDunn:master, r=pnkfelix
[rust.git] / src / test / ui / generic-associated-types / gat-in-trait-path.rs
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
21 fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {}
22 //~^ the trait `Foo` cannot be made into an object
23
24
25 fn main() {
26   let foo = Fooer(5);
27   f(Box::new(foo));
28 }