]>
Commit | Line | Data |
---|---|---|
0531ce1d | 1 | // run-pass |
0531ce1d | 2 | |
0531ce1d XL |
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 | ||
a7813a04 | 15 | fn main() { |
0531ce1d XL |
16 | let mut foo = Foo { x: 0 }; |
17 | match 22 { | |
18 | 22 => &mut foo, | |
19 | 44 => foo.twiddle(), | |
20 | _ => foo.twaddle(), | |
21 | }.emit(); | |
54a0048b | 22 | } |