rust/tests/ui/regions/region-borrow-params-issue-29793-small.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

364 lines
16 KiB
Plaintext
Raw Normal View History

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
|
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`
|
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
|
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`
|
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
|
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`
|
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
|
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`
|
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
2018-12-25 15:56:47 +00:00
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
|
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`
|
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
|
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`)
| ++++
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
|
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`
|
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
|
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`)
| ++++
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
|
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`
|
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
|
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`)
| ++++
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
|
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`
|
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
|
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
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`
|
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
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`)
| ++++
error: aborting due to 20 previous errors
For more information about this error, try `rustc --explain E0373`.