os-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
259 B
Rust
Raw Normal View History

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