about summary refs log tree commit diff
path: root/compiler/rustc_mir_build/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-22 10:17:09 +0000
committerbors <bors@rust-lang.org>2022-11-22 10:17:09 +0000
commitb7463e8bdb7b039e75241dcc4ea65bbd24d5c608 (patch)
tree837bf66b75c278b9baeb86df6ed75a3230f62fef /compiler/rustc_mir_build/src
parenta78c9bee4d9d51a3891bd8ecae1f28a93b83653b (diff)
parent7a5376d23cb3324edcfaa278a9387898960d5f7c (diff)
downloadrust-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_mir_build/src')
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/check_match.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
index 0df228a0d59..ba04cb6eef8 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
@@ -564,7 +564,7 @@ fn check_for_bindings_named_same_as_variants(
             && let ty::Adt(edef, _) = pat_ty.kind()
             && edef.is_enum()
             && edef.variants().iter().any(|variant| {
-                variant.ident(cx.tcx) == ident && variant.ctor_kind == CtorKind::Const
+                variant.ident(cx.tcx) == ident && variant.ctor_kind() == Some(CtorKind::Const)
             })
         {
             let variant_count = edef.variants().len();