diff options
| author | Ralf Jung <post@ralfj.de> | 2024-12-01 13:12:43 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-12-18 11:00:21 +0100 |
| commit | 21de42bf8ddd0f39c766c7705990152302ae1f3b (patch) | |
| tree | fd27ee9da12fb8c8682f7aaddb4dc749cfa1bfe6 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | 37e74596c0b59e81b9ac58657f92297ef4ccb7ef (diff) | |
| download | rust-21de42bf8ddd0f39c766c7705990152302ae1f3b.tar.gz rust-21de42bf8ddd0f39c766c7705990152302ae1f3b.zip | |
Variants::Single: do not use invalid VariantIdx for uninhabited enums
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs index d374767f187..8ec83fa7c92 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs @@ -213,11 +213,11 @@ pub(super) fn build_enum_type_di_node<'ll, 'tcx>( |cx, enum_type_di_node| { match enum_type_and_layout.variants { Variants::Single { index: variant_index } => { - if enum_adt_def.variants().is_empty() { + let Some(variant_index) = variant_index else { // Uninhabited enums have Variants::Single. We don't generate // any members for them. return smallvec![]; - } + }; build_single_variant_union_fields( cx, |
