diff options
| author | bors <bors@rust-lang.org> | 2022-11-22 10:17:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-22 10:17:09 +0000 |
| commit | b7463e8bdb7b039e75241dcc4ea65bbd24d5c608 (patch) | |
| tree | 837bf66b75c278b9baeb86df6ed75a3230f62fef /compiler/rustc_codegen_llvm | |
| parent | a78c9bee4d9d51a3891bd8ecae1f28a93b83653b (diff) | |
| parent | 7a5376d23cb3324edcfaa278a9387898960d5f7c (diff) | |
| download | rust-b7463e8bdb7b039e75241dcc4ea65bbd24d5c608.tar.gz rust-b7463e8bdb7b039e75241dcc4ea65bbd24d5c608.zip | |
Auto merge of #103578 - petrochenkov:nofict, r=nagisa
Unreserve braced enum variants in value namespace
With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed.
Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 163ccd9460c..d87117dffdc 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -998,7 +998,7 @@ fn build_struct_type_di_node<'ll, 'tcx>( .iter() .enumerate() .map(|(i, f)| { - let field_name = if variant_def.ctor_kind == CtorKind::Fn { + let field_name = if variant_def.ctor_kind() == Some(CtorKind::Fn) { // This is a tuple struct tuple_field_name(i) } else { diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs index cb558a50d91..564ab351bd4 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs @@ -269,7 +269,7 @@ fn build_enum_variant_struct_type_di_node<'ll, 'tcx>( |cx, struct_type_di_node| { (0..variant_layout.fields.count()) .map(|field_index| { - let field_name = if variant_def.ctor_kind != CtorKind::Fn { + let field_name = if variant_def.ctor_kind() != Some(CtorKind::Fn) { // Fields have names Cow::from(variant_def.fields[field_index].name.as_str()) } else { |
