blob: 850226f60cf7014ec1a003aea4f70d8d029cfcc7 [file] [log] [blame]
warning: not reporting region error due to nll
--> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24
|
LL | let mut f = || &mut x; //~ ERROR cannot infer
| ^^^^^^
error: unsatisfied lifetime constraints
--> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24
|
LL | let mut f = || &mut x; //~ ERROR cannot infer
| -- ^^^^^^ returning this value requires that `'1` must outlive `'2`
| ||
| |return type of closure is &'2 mut i32
| lifetime `'1` represents this closure's body
|
= note: closure implements `FnMut`, so references to captured variables can't escape the closure
error: aborting due to previous error