rust/src/test/compile-fail/regions-nested-fns-2.rs

11 lines
189 B
Rust
Raw Normal View History

fn ignore<T>(_t: T) {}
fn nested() {
let y = 3;
ignore(fn&(z: &z/int) -> &z/int {
2012-08-01 17:30:05 -07:00
if false { return &y; } //~ ERROR illegal borrow
return z;
});
}
fn main() {}