]>
Commit | Line | Data |
---|---|---|
17df50a5 | 1 | error[E0499]: cannot borrow `p` as mutable more than once at a time |
136023e0 | 2 | --> $DIR/borrowck-1.rs:12:17 |
17df50a5 XL |
3 | | |
4 | LL | let y = &mut p.y; | |
5 | | -------- first mutable borrow occurs here | |
6 | LL | let mut c = || { | |
7 | | ^^ second mutable borrow occurs here | |
8 | LL | | |
9 | LL | let x = &mut p.x; | |
10 | | --- capture is mutable because of use here | |
11 | LL | println!("{:?}", p); | |
12 | | - second borrow occurs due to use of `p` in closure | |
13 | ... | |
14 | LL | *y+=1; | |
15 | | ----- first borrow later used here | |
16 | ||
136023e0 | 17 | error: aborting due to previous error |
17df50a5 XL |
18 | |
19 | For more information about this error, try `rustc --explain E0499`. |