summaryrefslogtreecommitdiffstats
path: root/tests/ui/print_type_sizes/generator_discr_placement.rs
blob: 1a85fe95bb6f771679ae01786c1bd89c56a2ab6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// compile-flags: -Z print-type-sizes --crate-type lib
// build-pass
// ignore-pass

// Tests a generator that has its discriminant as the *final* field.

// Avoid emitting panic handlers, like the rest of these tests...
#![feature(generators)]

pub fn foo() {
    let a = || {
        {
            let w: i32 = 4;
            yield;
            drop(w);
        }
        {
            let z: i32 = 7;
            yield;
            drop(z);
        }
    };
}