1error[E0506]: cannot assign to `p` because it is borrowed
2  --> $DIR/mut_while_borrow.rs:9:5
3   |
4LL |     let r = foo(&p);
5   |                 -- borrow of `p` occurs here
6LL |     p += 1;
7   |     ^^^^^^ assignment to borrowed `p` occurs here
8LL |     println!("{}", r);
9   |                    - borrow later used here
10
11error: aborting due to previous error
12
13For more information about this error, try `rustc --explain E0506`.
14