1 // This tests that optimized enum debug info accurately reflects the enum layout.
2 // This is ignored for the fallback mode on MSVC due to problems with PDB.
7 // compile-flags: -g -C no-prepopulate-passes
9 // CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_variant_part,{{.*}}size: 32,{{.*}}
10 // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}}
11 // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
13 #![feature(never_type)]
15 #[derive(Copy, Clone)]
17 private: std::num::NonZeroU32,
20 #[derive(Copy, Clone, PartialEq, Eq)]
21 pub struct Declaration;
23 impl TypeFamily for Declaration {
27 fn intern_base_data(_: BaseKind<Self>) {}
30 #[derive(Copy, Clone)]
33 pub trait TypeFamily: Copy + 'static {
35 type Placeholder: Copy;
37 fn intern_base_data(_: BaseKind<Self>);
40 #[derive(Copy, Clone)]
41 pub enum BaseKind<F: TypeFamily> {
43 Placeholder(F::Placeholder),
48 let x = BaseKind::Error::<Declaration>;