]> git.proxmox.com Git - rustc.git/blob - tests/ui/print_type_sizes/generator_discr_placement.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / print_type_sizes / generator_discr_placement.rs
1 // compile-flags: -Z print-type-sizes --crate-type lib
2 // build-pass
3 // ignore-pass
4
5 // Tests a generator that has its discriminant as the *final* field.
6
7 // Avoid emitting panic handlers, like the rest of these tests...
8 #![feature(generators)]
9
10 pub fn foo() {
11 let a = || {
12 {
13 let w: i32 = 4;
14 yield;
15 drop(w);
16 }
17 {
18 let z: i32 = 7;
19 yield;
20 drop(z);
21 }
22 };
23 }