2018-08-30 14:18:55 +02:00
|
|
|
// 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;
|
2015-02-01 12:44:15 -05:00
|
|
|
assert_eq!((move || x + y)(), 5);
|
2014-11-06 20:44:08 -08:00
|
|
|
}
|