1 // revisions: base extended
3 #![cfg_attr(extended, feature(generic_associated_types_extended))]
4 #![cfg_attr(extended, allow(incomplete_features))]
9 type SubType<'a>: SubTrait where Self: 'a;
11 fn get_sub<'a>(&'a mut self) -> Self::SubType<'a>;
14 pub struct SubStruct<'a> {
15 sup: &'a mut SuperStruct,
18 impl<'a> SubTrait for SubStruct<'a> {}
20 pub struct SuperStruct {
25 pub fn new(value: u8) -> SuperStruct {
30 impl SuperTrait for SuperStruct {
31 type SubType<'a> = SubStruct<'a>;
33 fn get_sub<'a>(&'a mut self) -> Self::SubType<'a> {
34 SubStruct { sup: self }
39 let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
40 //~^ ERROR missing generics for associated type
41 //[base]~^^ ERROR the trait
42 //[base]~| ERROR the trait