1 warning: the feature `capture_disjoint_fields` is incomplete and may not be safe to use and/or cause compiler crashes
2 --> $DIR/borrowck-4.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[E0373]: closure may outlive the current function, but it borrows `p`, which is owned by the current function
11 --> $DIR/borrowck-4.rs:11:17
14 | ^^ may outlive borrowed value `p`
16 LL | println!("{:?}", p);
17 | - `p` is borrowed here
19 note: closure is returned here
20 --> $DIR/borrowck-4.rs:9:14
22 LL | fn foo () -> impl FnMut()->() {
24 help: to force the closure to take ownership of `p` (and any other referenced variables), use the `move` keyword
26 LL | let mut c = move || {
29 error: aborting due to previous error; 1 warning emitted
31 For more information about this error, try `rustc --explain E0373`.