]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/metadata-sufficient-for-layout.rs
Rollup merge of #82259 - osa1:issue82156, r=petrochenkov
[rust.git] / src / test / ui / generator / metadata-sufficient-for-layout.rs
1 // Check that the layout of a generator is available when auxiliary crate
2 // is compiled with --emit metadata.
3 //
4 // Regression test for #80998.
5 //
6 // aux-build:metadata-sufficient-for-layout.rs
7 // check-pass
8
9 #![feature(type_alias_impl_trait)]
10 #![feature(generator_trait)]
11
12 extern crate metadata_sufficient_for_layout;
13
14 use std::ops::Generator;
15
16 type F = impl Generator<(), Yield = (), Return = ()>;
17
18 // Static queries the layout of the generator.
19 static A: Option<F> = None;
20
21 fn f() -> F { metadata_sufficient_for_layout::g() }
22
23 fn main() {}