8 // Here the `&` is bound in the method definition:
9 fn get_ctxt(&self) -> &Ctxt;
16 impl<'a> GetCtxt for HasCtxt<'a> {
17 // Ok: Have implied bound of WF(&'b HasCtxt<'a>)
19 // so know &'a Ctxt <: &'b Ctxt
20 fn get_ctxt<'b>(&'b self) -> &'a Ctxt {
25 fn get_v(gc: Box<dyn GetCtxt + '_>) -> usize {
30 let ctxt = Ctxt { v: 22 };
31 let hc = HasCtxt { c: &ctxt };
32 assert_eq!(get_v(Box::new(hc) as Box<dyn GetCtxt>), 22);