about summary refs log tree commit diff
path: root/tests/ui/coroutine/niche-in-coroutine.rs
blob: f268ef09f8923320a27b8a312e9ae2efe0caf77a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test that niche finding works with captured coroutine upvars.

//@ run-pass

#![feature(coroutines, stmt_expr_attributes)]

use std::mem::size_of_val;

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

fn main() {
    let x = false;
    let gen1 = #[coroutine] || {
        yield;
        take(x);
    };

    // FIXME(#63818): niches in coroutines are disabled. Should be `assert_eq`.
    assert_ne!(size_of_val(&gen1), size_of_val(&Some(gen1)));
}