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