1 warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
2 --> $DIR/borrowck-2.rs:1:12
4 LL | #![feature(capture_disjoint_fields)]
5 | ^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `#[warn(incomplete_features)]` on by default
8 = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
10 error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
11 --> $DIR/borrowck-2.rs:13:17
14 | ---- immutable borrow occurs here
16 | ^^ mutable borrow occurs here
18 LL | println!("{:?}", p);
19 | - second borrow occurs due to use of `p` in closure
20 LL | let x = &mut p.x;
21 | --- capture is mutable because of use here
23 LL | println!("{}", y);
24 | - immutable borrow later used here
26 error: aborting due to previous error; 1 warning emitted
28 For more information about this error, try `rustc --explain E0502`.