]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/issue-18652.rs
Rollup merge of #107171 - petrochenkov:encattrs, r=cjgillot
[rust.git] / tests / ui / unboxed-closures / issue-18652.rs
1 // run-pass
2 // Tests multiple free variables being passed by value into an unboxed
3 // once closure as an optimization by codegen.  This used to hit an
4 // incorrect assert.
5
6 fn main() {
7     let x = 2u8;
8     let y = 3u8;
9     assert_eq!((move || x + y)(), 5);
10 }