1
Fork 0

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

@ -267,8 +267,8 @@ impl<'a> ExtCtxt<'a> {
pub fn expr_block(&self, b: P<ast::Block>) -> P<ast::Expr> {
self.expr(b.span, ast::ExprKind::Block(b, None))
}
pub fn field_imm(&self, span: Span, ident: Ident, e: P<ast::Expr>) -> ast::Field {
ast::Field {
pub fn field_imm(&self, span: Span, ident: Ident, e: P<ast::Expr>) -> ast::ExprField {
ast::ExprField {
ident: ident.with_span_pos(span),
expr: e,
span,
@ -282,7 +282,7 @@ impl<'a> ExtCtxt<'a> {
&self,
span: Span,
path: ast::Path,
fields: Vec<ast::Field>,
fields: Vec<ast::ExprField>,
) -> P<ast::Expr> {
self.expr(span, ast::ExprKind::Struct(path, fields, ast::StructRest::None))
}
@ -290,7 +290,7 @@ impl<'a> ExtCtxt<'a> {
&self,
span: Span,
id: Ident,
fields: Vec<ast::Field>,
fields: Vec<ast::ExprField>,
) -> P<ast::Expr> {
self.expr_struct(span, self.path_ident(span, id), fields)
}
@ -419,7 +419,7 @@ impl<'a> ExtCtxt<'a> {
&self,
span: Span,
path: ast::Path,
field_pats: Vec<ast::FieldPat>,
field_pats: Vec<ast::PatField>,
) -> P<ast::Pat> {
self.pat(span, PatKind::Struct(path, field_pats, false))
}