]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr
New upstream version 1.54.0+dfsg1
[rustc.git] / src / test / ui / closures / 2229_closure_analysis / diagnostics / borrowck / borrowck-4.stderr
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
3 |
4 LL | #![feature(capture_disjoint_fields)]
5 | ^^^^^^^^^^^^^^^^^^^^^^^
6 |
7 = note: `#[warn(incomplete_features)]` on by default
8 = note: see issue #53488 <https://github.com/rust-lang/rust/issues/53488> for more information
9
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
12 |
13 LL | let mut c = || {
14 | ^^ may outlive borrowed value `p`
15 ...
16 LL | println!("{:?}", p);
17 | - `p` is borrowed here
18 |
19 note: closure is returned here
20 --> $DIR/borrowck-4.rs:9:14
21 |
22 LL | fn foo () -> impl FnMut()->() {
23 | ^^^^^^^^^^^^^^^^
24 help: to force the closure to take ownership of `p` (and any other referenced variables), use the `move` keyword
25 |
26 LL | let mut c = move || {
27 | ^^^^^^^
28
29 error: aborting due to previous error; 1 warning emitted
30
31 For more information about this error, try `rustc --explain E0373`.