2019-04-22 07:40:08 +00:00
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
2017-12-10 19:47:55 +00:00
|
|
|
| |
|
2019-04-22 07:40:08 +00:00
|
|
|
| may outlive borrowed value `x`
|
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:12:16
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
2017-12-10 19:47:55 +00:00
|
|
|
| |
|
2019-04-22 07:40:08 +00:00
|
|
|
| may outlive borrowed value `y`
|
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:12:16
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
2017-12-10 19:47:55 +00:00
|
|
|
| |
|
2019-04-22 07:40:08 +00:00
|
|
|
| may outlive borrowed value `x`
|
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:27:9
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
2017-12-10 19:47:55 +00:00
|
|
|
| |
|
2019-04-22 07:40:08 +00:00
|
|
|
| may outlive borrowed value `y`
|
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:27:9
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
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`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 19:47:55 +00:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:58:16
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 19:47:55 +00:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:58:16
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 19:47:55 +00:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:69:9
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2018-02-23 00:42:32 +00:00
|
|
|
LL | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 19:47:55 +00:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:69:9
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:93:20
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:93:20
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:107:13
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:107:13
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:135:20
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:135:20
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:150:13
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:150:13
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:178:20
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:178:20
|
|
|
|
|
|
|
|
|
LL | return Box::new(f);
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:192:13
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
|
|
|
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`
|
2019-04-22 07:40:08 +00:00
|
|
|
|
|
|
|
|
note: closure is returned here
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:192:13
|
|
|
|
|
|
|
|
|
LL | Box::new(f)
|
|
|
|
| ^^^^^^^^^^^
|
2017-12-10 19:47:55 +00:00
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-23 00:42:32 +00:00
|
|
|
|
|
2018-02-24 23:01:39 +00:00
|
|
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2021-06-22 02:07:19 +00:00
|
|
|
| ++++
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error: aborting due to 20 previous errors
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
For more information about this error, try `rustc --explain E0373`.
|