2017-12-10 22:47:55 +03:00
|
|
|
error[E0597]: `x` does not live long enough
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:19:34
|
|
|
|
|
|
|
|
|
19 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-14 09:57:34 -08:00
|
|
|
| --------- ^ borrowed value does not live long enough
|
2017-12-10 22:47:55 +03:00
|
|
|
| |
|
|
|
|
| capture occurs here
|
|
|
|
...
|
2017-12-10 23:29:24 +03:00
|
|
|
23 | };
|
2017-12-10 22:47:55 +03:00
|
|
|
| - borrowed value dropped before borrower
|
|
|
|
|
|
|
|
|
= note: values in a scope are dropped in the opposite order they are created
|
|
|
|
|
|
|
|
error[E0597]: `y` does not live long enough
|
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:19:45
|
|
|
|
|
|
|
|
|
19 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-14 09:57:34 -08:00
|
|
|
| --------- ^ borrowed value does not live long enough
|
2017-12-10 22:47:55 +03:00
|
|
|
| |
|
|
|
|
| capture occurs here
|
|
|
|
...
|
2017-12-10 23:29:24 +03:00
|
|
|
23 | };
|
2017-12-10 22:47:55 +03:00
|
|
|
| - borrowed value dropped before borrower
|
|
|
|
|
|
|
|
|
= note: values in a scope are dropped in the opposite order they are created
|
|
|
|
|
|
|
|
error[E0597]: `x` does not live long enough
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:34:34
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
34 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-14 09:57:34 -08:00
|
|
|
| --------- ^ borrowed value does not live long enough
|
2017-12-10 22:47:55 +03:00
|
|
|
| |
|
|
|
|
| capture occurs here
|
|
|
|
...
|
2017-12-10 23:29:24 +03:00
|
|
|
38 | };
|
2017-12-10 22:47:55 +03:00
|
|
|
| - borrowed value dropped before borrower
|
|
|
|
|
|
|
|
|
= note: values in a scope are dropped in the opposite order they are created
|
|
|
|
|
|
|
|
error[E0597]: `y` does not live long enough
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:34:45
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
34 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-14 09:57:34 -08:00
|
|
|
| --------- ^ borrowed value does not live long enough
|
2017-12-10 22:47:55 +03:00
|
|
|
| |
|
|
|
|
| capture occurs here
|
|
|
|
...
|
2017-12-10 23:29:24 +03:00
|
|
|
38 | };
|
2017-12-10 22:47:55 +03:00
|
|
|
| - borrowed value dropped before borrower
|
|
|
|
|
|
|
|
|
= note: values in a scope are dropped in the opposite order they are created
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:65:17
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
65 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
65 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:65:17
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
65 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
65 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:76:17
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
76 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
76 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:76:17
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
76 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
76 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:100:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
100 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
100 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:100:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
100 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
100 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:114:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
114 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
114 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:114:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
114 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
114 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:142:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
142 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
142 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:142:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
142 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
142 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:157:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
157 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
157 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:157:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
157 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
157 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:185:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
185 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
185 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:185:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
185 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
185 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:199:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
199 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `x` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `x`
|
|
|
|
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
199 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
2017-12-10 23:29:24 +03:00
|
|
|
--> $DIR/region-borrow-params-issue-29793-small.rs:199:21
|
2017-12-10 22:47:55 +03:00
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
199 | let f = |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^ - `y` is borrowed here
|
|
|
|
| |
|
|
|
|
| may outlive borrowed value `y`
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
199 | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
|
2017-12-10 22:47:55 +03:00
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 20 previous errors
|
|
|
|
|
2018-02-19 21:40:25 +01:00
|
|
|
You've got a few errors: E0373, E0597
|
|
|
|
If you want more information on an error, try using "rustc --explain E0373"
|