]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/issue-32350.rs
Rollup merge of #106321 - compiler-errors:delayed-bug-backtrace, r=Nilstrieb
[rust.git] / tests / ui / associated-types / issue-32350.rs
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
12     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
24     fn get_cx(&'a self) -> &'a MyCtxt {
25         &self.ctxt
26     }
27 }
28
29 fn main() {}