1 // check-pass 2 3 // This is another instance of the "normalizations don't work" issue with 4 // defaulted associated types. 5 6 #![feature(associated_type_defaults)] 7 8 pub trait Emitter<'a> { 9 type Ctxt: 'a; 10 type CtxtBrw: 'a = &'a Self::Ctxt; 11 get_cx(&'a self) -> Self::CtxtBrw12 fn get_cx(&'a self) -> Self::CtxtBrw; 13 } 14 15 struct MyCtxt; 16 17 struct MyEmitter { 18 ctxt: MyCtxt 19 } 20 21 impl <'a> Emitter<'a> for MyEmitter { 22 type Ctxt = MyCtxt; 23 get_cx(&'a self) -> &'a MyCtxt24 fn get_cx(&'a self) -> &'a MyCtxt { 25 &self.ctxt 26 } 27 } 28 main()29fn main() {} 30