]> git.proxmox.com Git - rustc.git/blame - src/test/ui/generic-associated-types/gat-in-trait-path.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / generic-associated-types / gat-in-trait-path.rs
CommitLineData
5869c6ff 1#![feature(generic_associated_types)]
5869c6ff
XL
2#![feature(associated_type_defaults)]
3
4trait Foo {
5 type A<'a> where Self: 'a;
6}
7
8struct Fooy;
9
10impl Foo for Fooy {
11 type A<'a> = &'a ();
12}
13
14#[derive(Clone)]
15struct Fooer<T>(T);
16
17impl<T> Foo for Fooer<T> {
18 type A<'x> where T: 'x = &'x ();
19}
20
21fn 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
25fn main() {
26 let foo = Fooer(5);
27 f(Box::new(foo));
28}