rust/tests/ui/unboxed-closures/issue-18652.rs

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

11 lines
260 B
Rust
Raw Permalink Normal View History

//@ run-pass
2014-11-07 04:44:08 +00:00
// Tests multiple free variables being passed by value into an unboxed
2018-05-08 13:10:16 +00:00
// once closure as an optimization by codegen. This used to hit an
2014-11-07 04:44:08 +00:00
// incorrect assert.
fn main() {
let x = 2u8;
let y = 3u8;
assert_eq!((move || x + y)(), 5);
2014-11-07 04:44:08 +00:00
}