rust/tests/ui/closure_context/issue-26046-fn-mut.rs

12 lines
167 B
Rust
Raw Normal View History

2019-05-28 14:46:13 -04:00
fn foo() -> Box<dyn Fn()> {
let num = 5;
2017-11-20 13:13:27 +01:00
let closure = || { //~ ERROR expected a closure that
num += 1;
};
Box::new(closure)
}
fn main() {}