]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/metadata-sufficient-for-layout.rs
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[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
8 #![feature(type_alias_impl_trait, rustc_attrs)]
9 #![feature(generator_trait)]
10
11 extern crate metadata_sufficient_for_layout;
12
13 use std::ops::Generator;
14
15 type F = impl Generator<(), Yield = (), Return = ()>;
16
17 // Static queries the layout of the generator.
18 static A: Option<F> = None;
19
20 fn f() -> F {
21     metadata_sufficient_for_layout::g()
22 }
23
24 #[rustc_error]
25 fn main() {} //~ ERROR