1 error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as mutable
2 --> $DIR/issue-11192.rs:30:10
4 LL | let mut test = |foo: &Foo| {
5 | ----------- mutable borrow occurs here
6 LL | println!("access {}", foo.x);
7 LL | ptr = box Foo { x: ptr.x + 1 };
8 | --- first borrow occurs due to use of `ptr` in closure
13 | | immutable borrow occurs here
14 | borrow later used here
16 error: aborting due to previous error
18 For more information about this error, try `rustc --explain E0502`.