summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/issue-18652.rs
blob: 59aa01568429a64743066a429b0296760efd9d5a (plain)
1
2
3
4
5
6
7
8
9
10
// run-pass
// Tests multiple free variables being passed by value into an unboxed
// once closure as an optimization by codegen.  This used to hit an
// incorrect assert.

fn main() {
    let x = 2u8;
    let y = 3u8;
    assert_eq!((move || x + y)(), 5);
}