]>
Commit | Line | Data |
---|---|---|
5869c6ff XL |
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 | |
5869c6ff | 7 | |
94222f64 | 8 | #![feature(type_alias_impl_trait, rustc_attrs)] |
5869c6ff XL |
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 | ||
136023e0 XL |
20 | fn f() -> F { |
21 | metadata_sufficient_for_layout::g() | |
22 | } | |
5869c6ff | 23 | |
6a06907d | 24 | #[rustc_error] |
136023e0 | 25 | fn main() {} //~ ERROR |