mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
364 lines
16 KiB
Plaintext
364 lines
16 KiB
Plaintext
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:9:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:12:16
|
|
|
|
|
LL | return f;
|
|
| ^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:9:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:12:16
|
|
|
|
|
LL | return f;
|
|
| ^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:24:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:27:9
|
|
|
|
|
LL | f
|
|
| ^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:24:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:27:9
|
|
|
|
|
LL | f
|
|
| ^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:58:16
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:58:16
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:69:9
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:69:9
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:93:20
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:93:20
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:107:13
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:107:13
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:135:20
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:135:20
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:150:13
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:150:13
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:178:20
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:178:20
|
|
|
|
|
LL | return Box::new(f);
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `x`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:192:13
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
|
|
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
| |
|
|
| may outlive borrowed value `y`
|
|
|
|
|
note: closure is returned here
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:192:13
|
|
|
|
|
LL | Box::new(f)
|
|
| ^^^^^^^^^^^
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
|
| ++++
|
|
|
|
error: aborting due to 20 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0373`.
|