diff options
Diffstat (limited to 'tests/ui/print_type_sizes/generator_discr_placement.rs')
-rw-r--r-- | tests/ui/print_type_sizes/generator_discr_placement.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/print_type_sizes/generator_discr_placement.rs b/tests/ui/print_type_sizes/generator_discr_placement.rs new file mode 100644 index 000000000..1a85fe95b --- /dev/null +++ b/tests/ui/print_type_sizes/generator_discr_placement.rs @@ -0,0 +1,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); + } + }; +} |