os-rust/tests/ui/coroutine/overlap-locals.rs

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

31 lines
562 B
Rust
Raw Normal View History

//@ run-pass
#![feature(coroutines, stmt_expr_attributes)]
2019-05-09 18:13:40 -07:00
fn main() {
let a = #[coroutine]
|| {
2019-05-09 18:13:40 -07:00
{
let w: i32 = 4;
yield;
println!("{:?}", w);
}
{
let x: i32 = 5;
yield;
println!("{:?}", x);
}
{
let y: i32 = 6;
yield;
println!("{:?}", y);
}
{
let z: i32 = 7;
yield;
println!("{:?}", z);
}
};
assert_eq!(8, std::mem::size_of_val(&a));
}