rust/tests/ui/coroutine/niche-in-coroutine.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
308 B
Rust
Raw Normal View History

2023-10-19 21:46:28 +00:00
// Test that niche finding works with captured coroutine upvars.
2019-08-03 01:06:15 +00:00
// run-pass
2023-10-19 21:46:28 +00:00
#![feature(coroutines)]
2019-08-03 01:06:15 +00:00
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)));
}