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
19 fn my_write(&self, _: &dyn MyDisplay) { }
23 fn process_detail_fmt(&self, _: &mut dyn MyWrite);
28 impl ProcessType for Process {
29 fn process_detail_fmt(&self, writer: &mut dyn MyWrite)
32 let mut val: Option<<S as MPU>::MpuConfig> = None;
33 let valref: &mut <S as MPU>::MpuConfig = val.as_mut().unwrap();
35 // // This causes a different ICE (but its similar if you squint right):
37 // // `Unimplemented` selecting `Binder(<T as MyDisplay>)` during codegen
39 writer.my_write(valref)
40 //~^ ERROR the trait bound `T: MyDisplay` is not satisfied
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();