ast/hir: Rename field-related structures

StructField -> FieldDef ("field definition")
Field -> ExprField ("expression field", not "field expression")
FieldPat -> PatField ("pattern field", not "field pattern")

Also rename visiting and other methods working on them.
This commit is contained in:
Vadim Petrochenkov
2021-03-16 00:36:07 +03:00
parent 195ad4830e
commit b25d3ba781
57 changed files with 313 additions and 301 deletions

View File

@@ -2607,8 +2607,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
&mut self,
span: Span,
pat: &'hir hir::Pat<'hir>,
) -> &'hir [hir::FieldPat<'hir>] {
let field = hir::FieldPat {
) -> &'hir [hir::PatField<'hir>] {
let field = hir::PatField {
hir_id: self.next_id(),
ident: Ident::new(sym::integer(0), span),
is_shorthand: false,
@@ -2622,7 +2622,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
&mut self,
span: Span,
lang_item: hir::LangItem,
fields: &'hir [hir::FieldPat<'hir>],
fields: &'hir [hir::PatField<'hir>],
) -> &'hir hir::Pat<'hir> {
let qpath = hir::QPath::LangItem(lang_item, span);
self.pat(span, hir::PatKind::Struct(qpath, fields, false))