1 #![feature(generic_associated_types)]
6 type SubType<'a>: SubTrait where Self: 'a;
8 fn get_sub<'a>(&'a mut self) -> Self::SubType<'a>;
11 pub struct SubStruct<'a> {
12 sup: &'a mut SuperStruct,
15 impl<'a> SubTrait for SubStruct<'a> {}
17 pub struct SuperStruct {
22 pub fn new(value: u8) -> SuperStruct {
27 impl SuperTrait for SuperStruct {
28 type SubType<'a> = SubStruct<'a>;
30 fn get_sub<'a>(&'a mut self) -> Self::SubType<'a> {
31 SubStruct { sup: self }
36 let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
37 //~^ ERROR missing generics for associated type