rust/src/test/compile-fail/borrowck-move-by-capture.rs

9 lines
279 B
Rust
Raw Normal View History

pub fn main() {
// FIXME(#2202) - Due to the way that borrowck treats closures,
// you get two error reports here.
let bar = ~3;
let _g = || { //~ ERROR capture of moved value
let _h: proc() -> int = proc() *bar; //~ ERROR capture of moved value
};
}