]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-48070.rs
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / nll / issue-48070.rs
1 // run-pass
2
3 struct Foo {
4     x: u32
5 }
6
7 impl Foo {
8     fn twiddle(&mut self) -> &mut Self { self }
9     fn twaddle(&mut self) -> &mut Self { self }
10     fn emit(&mut self) {
11         self.x += 1;
12     }
13 }
14
15 fn main() {
16     let mut foo = Foo { x: 0 };
17     match 22 {
18         22 => &mut foo,
19         44 => foo.twiddle(),
20         _ => foo.twaddle(),
21     }.emit();
22 }