1 // revisions: base extended
3 #![feature(generic_associated_types)]
4 #![cfg_attr(extended, feature(generic_associated_types_extended))]
5 #![cfg_attr(extended, allow(incomplete_features))]
10 type SubType<'a>: SubTrait where Self: 'a;
12 fn get_sub<'a>(&'a mut self) -> Self::SubType<'a>;
15 pub struct SubStruct<'a> {
16 sup: &'a mut SuperStruct,
19 impl<'a> SubTrait for SubStruct<'a> {}
21 pub struct SuperStruct {
26 pub fn new(value: u8) -> SuperStruct {
31 impl SuperTrait for SuperStruct {
32 type SubType<'a> = SubStruct<'a>;
34 fn get_sub<'a>(&'a mut self) -> Self::SubType<'a> {
35 SubStruct { sup: self }
40 let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
41 //~^ ERROR missing generics for associated type
42 //[base]~^^ ERROR the trait
43 //[base]~| ERROR the trait