Skip to content

Commit f860408

Browse files
committed
Fix debug info for tagged enums
1 parent 0aa8d03 commit f860408

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_codegen_llvm/debuginfo/metadata.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,7 @@ fn prepare_union_metadata(
11611161
// offset of zero bytes).
11621162
struct EnumMemberDescriptionFactory<'ll, 'tcx> {
11631163
enum_type: Ty<'tcx>,
1164+
enum_type_size: Size,
11641165
layout: TyLayout<'tcx>,
11651166
discriminant_type_metadata: Option<&'ll DIType>,
11661167
containing_scope: &'ll DIScope,
@@ -1222,7 +1223,7 @@ impl EnumMemberDescriptionFactory<'ll, 'tcx> {
12221223
name: "".to_string(),
12231224
type_metadata: variant_type_metadata,
12241225
offset: Size::ZERO,
1225-
size: variant.size,
1226+
size: self.enum_type_size,
12261227
align: variant.align,
12271228
flags: DIFlags::FlagZero
12281229
}
@@ -1508,6 +1509,7 @@ fn prepare_enum_metadata(
15081509
enum_metadata,
15091510
EnumMDF(EnumMemberDescriptionFactory {
15101511
enum_type,
1512+
enum_type_size,
15111513
layout,
15121514
discriminant_type_metadata,
15131515
containing_scope,

0 commit comments

Comments
 (0)