diff options
Diffstat (limited to 'tests/ui/print_type_sizes/generator.rs')
-rw-r--r-- | tests/ui/print_type_sizes/generator.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/print_type_sizes/generator.rs b/tests/ui/print_type_sizes/generator.rs new file mode 100644 index 000000000..d1cd36274 --- /dev/null +++ b/tests/ui/print_type_sizes/generator.rs @@ -0,0 +1,18 @@ +// compile-flags: -Z print-type-sizes --crate-type=lib +// build-pass +// ignore-pass + +#![feature(generators, generator_trait)] + +use std::ops::Generator; + +fn generator<const C: usize>(array: [u8; C]) -> impl Generator<Yield = (), Return = ()> { + move |()| { + yield (); + let _ = array; + } +} + +pub fn foo() { + let _ = generator([0; 8192]); +} |