Skip to content

Commit 7a5376d

Browse files
committedNov 21, 2022
Unreserve braced enum variants in value namespace
1 parent 1cbc459 commit 7a5376d

File tree

71 files changed

+364
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+364
-642
lines changed
 

‎compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2664,7 +2664,7 @@ impl VariantData {
26642664
}
26652665

26662666
/// Return the `NodeId` of this variant's constructor, if it has one.
2667-
pub fn ctor_id(&self) -> Option<NodeId> {
2667+
pub fn ctor_node_id(&self) -> Option<NodeId> {
26682668
match *self {
26692669
VariantData::Struct(..) => None,
26702670
VariantData::Tuple(_, id) | VariantData::Unit(id) => Some(id),

‎compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
350350
} else {
351351
def.non_enum_variant()
352352
};
353-
if !including_tuple_field.0 && variant.ctor_kind == CtorKind::Fn {
353+
if !including_tuple_field.0 && variant.ctor_kind() == Some(CtorKind::Fn) {
354354
return None;
355355
}
356356
Some(variant.fields[field.index()].name.to_string())

0 commit comments

Comments
 (0)