2017-12-10 13:47:55 -06:00
|
|
|
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
|
|
|
|
--> $DIR/regions-nested-fns-2.rs:16:9
|
|
|
|
|
|
|
|
|
16 | |z| {
|
|
|
|
| ^^^ may outlive borrowed value `y`
|
2017-12-10 14:29:24 -06:00
|
|
|
17 | //~^ ERROR E0373
|
|
|
|
18 | if false { &y } else { z }
|
2017-12-10 13:47:55 -06:00
|
|
|
| - `y` is borrowed here
|
|
|
|
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
|
|
|
|
|
|
|
|
16 | move |z| {
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-02-19 14:40:25 -06:00
|
|
|
If you want more information on this error, try using "rustc --explain E0373"
|