Closed
Description
The following code gives an internal compiler error. It is a normal compiler error without NLL.
#![feature(nll)]
fn foo(x: &i32) -> &i32 {
let z = 4;
let f = &|y| { y };
let k = f(&z);
f(x)
}
fn main() {}
error: internal compiler error: unexpected region for local data ReFree(DefId(0/0:3 ~ example[8787]::foo[0]), BrAnon(0))
--> <source>:9:17
|
6 | let k = f(&z);
| ^
error: aborting due to previous error
Compiler returned: 101