summaryrefslogtreecommitdiffstats
path: root/tests/ui/coroutine/niche-in-coroutine.rs
blob: 7ad4c6bc98aca18edbbae32c210d50ab40163289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Test that niche finding works with captured coroutine upvars.

// run-pass

#![feature(coroutines)]

use std::mem::size_of_val;

fn take<T>(_: T) {}

fn main() {
    let x = false;
    let gen1 = || {
        yield;
        take(x);
    };

    assert_eq!(size_of_val(&gen1), size_of_val(&Some(gen1)));
}