rust/src/test/ui/regions/regions-nested-fns-2.stderr

17 lines
599 B
Plaintext
Raw Normal View History

error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
2018-12-25 09:56:47 -06:00
--> $DIR/regions-nested-fns-2.rs:6:9
|
2018-02-22 18:42:32 -06:00
LL | |z| {
| ^^^ may outlive borrowed value `y`
2019-03-09 06:03:44 -06:00
LL |
2018-02-22 18:42:32 -06:00
LL | if false { &y } else { z }
| - `y` is borrowed here
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
2018-02-24 17:01:39 -06:00
LL | move |z| {
| ^^^^^^^^
error: aborting due to previous error
2018-03-03 08:59:40 -06:00
For more information about this error, try `rustc --explain E0373`.