]>
Commit | Line | Data |
---|---|---|
223e47cc | 1 | struct Foo { |
1a4d82fc | 2 | x: isize, |
223e47cc LB |
3 | } |
4 | ||
970d7e83 LB |
5 | impl Foo { |
6 | pub fn f(&self) {} | |
970d7e83 | 7 | pub fn h(&mut self) {} |
223e47cc LB |
8 | } |
9 | ||
10 | fn a(x: &mut Foo) { | |
11 | x.f(); | |
223e47cc LB |
12 | x.h(); |
13 | } | |
14 | ||
15 | fn b(x: &Foo) { | |
16 | x.f(); | |
970d7e83 | 17 | x.h(); //~ ERROR cannot borrow |
223e47cc LB |
18 | } |
19 | ||
223e47cc LB |
20 | fn main() { |
21 | } |