1 #![feature(associated_type_defaults)]
3 trait MyDisplay { fn method(&self) { } }
5 impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }
10 type MpuConfig: MyDisplay = T;
11 //~^ ERROR the trait bound `T: MyDisplay` is not satisfied
17 //~^ ERROR the trait bound `T: MyDisplay` is not satisfied
20 fn my_write(&self, _: &dyn MyDisplay) { }
24 fn process_detail_fmt(&self, _: &mut dyn MyWrite);
29 impl ProcessType for Process {
30 fn process_detail_fmt(&self, writer: &mut dyn MyWrite)
33 let mut val: Option<<S as MPU>::MpuConfig> = None;
34 let valref: &mut <S as MPU>::MpuConfig = val.as_mut().unwrap();
36 // // This causes a different ICE (but its similar if you squint right):
38 // // `Unimplemented` selecting `Binder(<T as MyDisplay>)` during codegen
40 // writer.my_write(valref)
42 // This one causes the ICE:
43 // FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<T as MyDisplay>)),
44 // depth=1),Unimplemented)
45 let closure = |config: &mut <S as MPU>::MpuConfig| writer.my_write(&config);
50 fn create() -> &'static dyn ProcessType {
51 let input: Option<&mut Process> = None;
52 let process: &mut Process = input.unwrap();