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.

21 lines
424 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
#![feature(coroutines, stmt_expr_attributes)]
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 = #[coroutine] || {
2019-08-03 01:06:15 +00:00
yield;
take(x);
};
2024-08-20 16:33:25 +00:00
// FIXME(#63818): niches in coroutines are disabled. Should be `assert_eq`.
assert_ne!(size_of_val(&gen1), size_of_val(&Some(gen1)));
2019-08-03 01:06:15 +00:00
}