X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibsyntax%2Fext%2Fbuild.rs;h=6b93d045588b9242b62080aecb23cf6fc3704e3d;hb=7bc94cc3c2ccef8b4d393910bb978a6487db1202;hp=f903b66e2961d4e2487bd58ae634b195b283b739;hpb=c26f1296d2d7a5f0c6e0b4f5cc00d59b341bcf09;p=rust.git diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index f903b66e296..6b93d045588 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -54,11 +54,11 @@ pub fn ty_mt(&self, ty: P, mutbl: ast::Mutability) -> ast::MutTy { } } - pub fn ty(&self, span: Span, ty: ast::TyKind) -> P { + pub fn ty(&self, span: Span, kind: ast::TyKind) -> P { P(ast::Ty { id: ast::DUMMY_NODE_ID, span, - node: ty + kind, }) } @@ -73,12 +73,12 @@ pub fn ty_ident(&self, span: Span, ident: ast::Ident) self.ty_path(self.path_ident(span, ident)) } - pub fn anon_const(&self, span: Span, expr: ast::ExprKind) -> ast::AnonConst { + pub fn anon_const(&self, span: Span, kind: ast::ExprKind) -> ast::AnonConst { ast::AnonConst { id: ast::DUMMY_NODE_ID, value: P(ast::Expr { id: ast::DUMMY_NODE_ID, - node: expr, + kind, span, attrs: ThinVec::new(), }) @@ -171,7 +171,7 @@ pub fn stmt_expr(&self, expr: P) -> ast::Stmt { ast::Stmt { id: ast::DUMMY_NODE_ID, span: expr.span, - node: ast::StmtKind::Expr(expr), + kind: ast::StmtKind::Expr(expr), } } @@ -193,7 +193,7 @@ pub fn stmt_let(&self, sp: Span, mutbl: bool, ident: ast::Ident, }); ast::Stmt { id: ast::DUMMY_NODE_ID, - node: ast::StmtKind::Local(local), + kind: ast::StmtKind::Local(local), span: sp, } } @@ -210,7 +210,7 @@ pub fn stmt_let_type_only(&self, span: Span, ty: P) -> ast::Stmt { }); ast::Stmt { id: ast::DUMMY_NODE_ID, - node: ast::StmtKind::Local(local), + kind: ast::StmtKind::Local(local), span, } } @@ -218,7 +218,7 @@ pub fn stmt_let_type_only(&self, span: Span, ty: P) -> ast::Stmt { pub fn stmt_item(&self, sp: Span, item: P) -> ast::Stmt { ast::Stmt { id: ast::DUMMY_NODE_ID, - node: ast::StmtKind::Item(item), + kind: ast::StmtKind::Item(item), span: sp, } } @@ -227,7 +227,7 @@ pub fn block_expr(&self, expr: P) -> P { self.block(expr.span, vec![ast::Stmt { id: ast::DUMMY_NODE_ID, span: expr.span, - node: ast::StmtKind::Expr(expr), + kind: ast::StmtKind::Expr(expr), }]) } pub fn block(&self, span: Span, stmts: Vec) -> P { @@ -239,10 +239,10 @@ pub fn block(&self, span: Span, stmts: Vec) -> P { }) } - pub fn expr(&self, span: Span, node: ast::ExprKind) -> P { + pub fn expr(&self, span: Span, kind: ast::ExprKind) -> P { P(ast::Expr { id: ast::DUMMY_NODE_ID, - node, + kind, span, attrs: ThinVec::new(), }) @@ -411,8 +411,8 @@ pub fn expr_try(&self, sp: Span, head: P) -> P { } - pub fn pat(&self, span: Span, pat: PatKind) -> P { - P(ast::Pat { id: ast::DUMMY_NODE_ID, node: pat, span }) + pub fn pat(&self, span: Span, kind: PatKind) -> P { + P(ast::Pat { id: ast::DUMMY_NODE_ID, kind, span }) } pub fn pat_wild(&self, span: Span) -> P { self.pat(span, PatKind::Wild) @@ -567,14 +567,14 @@ pub fn fn_decl(&self, inputs: Vec, output: ast::FunctionRetTy) -> P< } pub fn item(&self, span: Span, name: Ident, - attrs: Vec, node: ast::ItemKind) -> P { + attrs: Vec, kind: ast::ItemKind) -> P { // FIXME: Would be nice if our generated code didn't violate // Rust coding conventions P(ast::Item { ident: name, attrs, id: ast::DUMMY_NODE_ID, - node, + kind, vis: respan(span.shrink_to_lo(), ast::VisibilityKind::Inherited), span, tokens: None,