From b6f5540739e6577e39c329e40cb2e655c67c46e3 Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Tue, 19 Dec 2023 14:10:15 +0000 Subject: [PATCH] Document recovered field in `VariantData`. --- compiler/rustc_ast/src/ast.rs | 2 ++ compiler/rustc_hir/src/hir.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 9d543563c0f96..c455900034872 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2788,6 +2788,8 @@ pub enum VariantData { /// Struct variant. /// /// E.g., `Bar { .. }` as in `enum Foo { Bar { .. } }`. + /// + /// The `bool` is whether it was recovered by the parser. Struct(ThinVec, bool), /// Tuple variant. /// diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index d148137091cf4..6aef88b21d536 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -2848,7 +2848,9 @@ pub enum VariantData<'hir> { /// A struct variant. /// /// E.g., `Bar { .. }` as in `enum Foo { Bar { .. } }`. - Struct(&'hir [FieldDef<'hir>], /* recovered */ bool), + /// + /// The `bool` is whether it was recovered by the parser. + Struct(&'hir [FieldDef<'hir>], bool), /// A tuple variant. /// /// E.g., `Bar(..)` as in `enum Foo { Bar(..) }`.