rust/src/test/compile-fail/bad-var-env-capture-in-block-arg.rs

7 lines
152 B
Rust

fn main() {
let x = 3;
fn blah(_a: native fn()) {}
blah({||
log(debug, x); //! ERROR attempted dynamic environment capture
});
}