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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
167 B
Rust
Raw Normal View History

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