diff options
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 16 | ||||
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/placeholders.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate/check.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/mut_visit.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/diagnostics.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/expr.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/item.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser/ty.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 2 |
14 files changed, 37 insertions, 37 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index f5a9c18dba1..73751c422f6 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -525,7 +525,7 @@ impl Pat { /// Attempt reparsing the pattern as a type. /// This is intended for use by diagnostics. pub(super) fn to_ty(&self) -> Option<P<Ty>> { - let node = match &self.kind { + let kind = match &self.kind { // In a type expression `_` is an inference variable. PatKind::Wild => TyKind::Infer, // An IDENT pattern with no binding mode would be valid as path to a type. E.g. `u32`. @@ -555,7 +555,7 @@ impl Pat { }; Some(P(Ty { - node, + kind, id: self.id, span: self.span, })) @@ -1051,7 +1051,7 @@ impl Expr { }; Some(P(Ty { - node: kind, + kind, id: self.id, span: self.span, })) @@ -1664,7 +1664,7 @@ pub enum AssocTyConstraintKind { #[derive(Clone, RustcEncodable, RustcDecodable)] pub struct Ty { pub id: NodeId, - pub node: TyKind, + pub kind: TyKind, pub span: Span, } @@ -1823,9 +1823,9 @@ impl Param { pub fn to_self(&self) -> Option<ExplicitSelf> { if let PatKind::Ident(BindingMode::ByValue(mutbl), ident, _) = self.pat.kind { if ident.name == kw::SelfLower { - return match self.ty.node { + return match self.ty.kind { TyKind::ImplicitSelf => Some(respan(self.pat.span, SelfKind::Value(mutbl))), - TyKind::Rptr(lt, MutTy { ref ty, mutbl }) if ty.node.is_implicit_self() => { + TyKind::Rptr(lt, MutTy { ref ty, mutbl }) if ty.kind.is_implicit_self() => { Some(respan(self.pat.span, SelfKind::Region(lt, mutbl))) } _ => Some(respan( @@ -1850,7 +1850,7 @@ impl Param { let span = eself.span.to(eself_ident.span); let infer_ty = P(Ty { id: DUMMY_NODE_ID, - node: TyKind::ImplicitSelf, + kind: TyKind::ImplicitSelf, span, }); let param = |mutbl, ty| Param { @@ -1872,7 +1872,7 @@ impl Param { Mutability::Immutable, P(Ty { id: DUMMY_NODE_ID, - node: TyKind::Rptr( + kind: TyKind::Rptr( lt, MutTy { ty: infer_ty, diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 22c07b2cf9c..a0093808412 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -568,7 +568,7 @@ impl DummyResult { pub fn raw_ty(sp: Span, is_error: bool) -> P<ast::Ty> { P(ast::Ty { id: ast::DUMMY_NODE_ID, - node: if is_error { ast::TyKind::Err } else { ast::TyKind::Tup(Vec::new()) }, + kind: if is_error { ast::TyKind::Err } else { ast::TyKind::Tup(Vec::new()) }, span: sp }) } diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index ff52bd1e971..98b434abea4 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -54,11 +54,11 @@ impl<'a> ExtCtxt<'a> { } } - pub fn ty(&self, span: Span, ty: ast::TyKind) -> P<ast::Ty> { + pub fn ty(&self, span: Span, kind: ast::TyKind) -> P<ast::Ty> { P(ast::Ty { id: ast::DUMMY_NODE_ID, span, - node: ty + kind, }) } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 13ac6266fb6..98a4de4cfe9 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1348,13 +1348,13 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> { } fn visit_ty(&mut self, ty: &mut P<ast::Ty>) { - match ty.node { + match ty.kind { ast::TyKind::Mac(_) => {} _ => return noop_visit_ty(ty, self), }; visit_clobber(ty, |mut ty| { - match mem::replace(&mut ty.node, ast::TyKind::Err) { + match mem::replace(&mut ty.kind, ast::TyKind::Err) { ast::TyKind::Mac(mac) => self.collect_bang(mac, ty.span, AstFragmentKind::Ty).make_ty(), _ => unreachable!(), diff --git a/src/libsyntax/ext/placeholders.rs b/src/libsyntax/ext/placeholders.rs index a1278c9c7a8..05b4985bb73 100644 --- a/src/libsyntax/ext/placeholders.rs +++ b/src/libsyntax/ext/placeholders.rs @@ -34,7 +34,7 @@ pub fn placeholder(kind: AstFragmentKind, id: ast::NodeId) -> AstFragment { }); let ty = P(ast::Ty { id, - node: ast::TyKind::Mac(mac_placeholder()), + kind: ast::TyKind::Mac(mac_placeholder()), span, }); let pat = P(ast::Pat { @@ -71,7 +71,7 @@ pub fn placeholder(kind: AstFragmentKind, id: ast::NodeId) -> AstFragment { id, span, kind: ast::PatKind::Mac(mac_placeholder()), })), AstFragmentKind::Ty => AstFragment::Ty(P(ast::Ty { - id, span, node: ast::TyKind::Mac(mac_placeholder()), + id, span, kind: ast::TyKind::Mac(mac_placeholder()), })), AstFragmentKind::Stmts => AstFragment::Stmts(smallvec![{ let mac = P((mac_placeholder(), ast::MacStmtStyle::Braces, ThinVec::new())); @@ -318,7 +318,7 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> { } fn visit_ty(&mut self, ty: &mut P<ast::Ty>) { - match ty.node { + match ty.kind { ast::TyKind::Mac(_) => *ty = self.remove(ty.id).make_ty(), _ => noop_visit_ty(ty, self), } diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs index b041c2d46a1..1729ae7eae8 100644 --- a/src/libsyntax/feature_gate/check.rs +++ b/src/libsyntax/feature_gate/check.rs @@ -432,7 +432,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } fn visit_ty(&mut self, ty: &'a ast::Ty) { - match ty.node { + match ty.kind { ast::TyKind::BareFn(ref bare_fn_ty) => { self.check_abi(bare_fn_ty.abi, ty.span); } @@ -447,7 +447,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { fn visit_fn_ret_ty(&mut self, ret_ty: &'a ast::FunctionRetTy) { if let ast::FunctionRetTy::Ty(ref output_ty) = *ret_ty { - if let ast::TyKind::Never = output_ty.node { + if let ast::TyKind::Never = output_ty.kind { // Do nothing. } else { self.visit_ty(output_ty) diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 3e2a1fa6a80..c08e154e045 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -432,9 +432,9 @@ pub fn noop_visit_ty_constraint<T: MutVisitor>( } pub fn noop_visit_ty<T: MutVisitor>(ty: &mut P<Ty>, vis: &mut T) { - let Ty { id, node, span } = ty.deref_mut(); + let Ty { id, kind, span } = ty.deref_mut(); vis.visit_id(id); - match node { + match kind { TyKind::Infer | TyKind::ImplicitSelf | TyKind::Err | TyKind::Never | TyKind::CVarArgs => {} TyKind::Slice(ty) => vis.visit_ty(ty), diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs index ecc1cdd8bca..62cb836e31e 100644 --- a/src/libsyntax/parse/diagnostics.rs +++ b/src/libsyntax/parse/diagnostics.rs @@ -25,7 +25,7 @@ crate fn dummy_arg(ident: Ident) -> Param { span: ident.span, }); let ty = Ty { - node: TyKind::Err, + kind: TyKind::Err, span: ident.span, id: ast::DUMMY_NODE_ID }; @@ -135,7 +135,7 @@ impl RecoverQPath for Ty { fn recovered(qself: Option<QSelf>, path: ast::Path) -> Self { Self { span: path.span, - node: TyKind::Path(qself, path), + kind: TyKind::Path(qself, path), id: ast::DUMMY_NODE_ID, } } @@ -663,7 +663,7 @@ impl<'a> Parser<'a> { pprust::ty_to_string(ty) ); - match ty.node { + match ty.kind { TyKind::Rptr(ref lifetime, ref mut_ty) => { let sum_with_parens = pprust::to_string(|s| { s.s.word("&"); @@ -1296,7 +1296,7 @@ impl<'a> Parser<'a> { is_trait_item: bool, ) -> PResult<'a, ast::Param> { let sp = param.pat.span; - param.ty.node = TyKind::Err; + param.ty.kind = TyKind::Err; let mut err = self.struct_span_err(sp, "unexpected `self` parameter in function"); if is_trait_item { err.span_label(sp, "must be the first associated function parameter"); @@ -1360,7 +1360,7 @@ impl<'a> Parser<'a> { let mut seen_inputs = FxHashSet::default(); for input in fn_inputs.iter_mut() { let opt_ident = if let (PatKind::Ident(_, ident, _), TyKind::Err) = ( - &input.pat.kind, &input.ty.node, + &input.pat.kind, &input.ty.kind, ) { Some(*ident) } else { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b2b6504919e..cc582819b6b 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1212,7 +1212,7 @@ impl<'a> Parser<'a> { do_not_enforce_named_arguments_for_c_variadic ) { Ok(param) => { - if let TyKind::CVarArgs = param.ty.node { + if let TyKind::CVarArgs = param.ty.kind { c_variadic = true; if p.token != token::CloseDelim(token::Paren) { let span = p.token.span; diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index deb2140f797..c776704b285 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -555,7 +555,7 @@ impl<'a> Parser<'a> { let span_after_type = parser_snapshot_after_type.token.span; let expr = mk_expr(self, P(Ty { span: path.span, - node: TyKind::Path(None, path), + kind: TyKind::Path(None, path), id: DUMMY_NODE_ID, })); @@ -1190,7 +1190,7 @@ impl<'a> Parser<'a> { } else { P(Ty { id: DUMMY_NODE_ID, - node: TyKind::Infer, + kind: TyKind::Infer, span: self.prev_span, }) }; diff --git a/src/libsyntax/parse/parser/item.rs b/src/libsyntax/parse/parser/item.rs index e96d35e1999..27b0325db12 100644 --- a/src/libsyntax/parse/parser/item.rs +++ b/src/libsyntax/parse/parser/item.rs @@ -678,7 +678,7 @@ impl<'a> Parser<'a> { self.look_ahead(1, |t| t != &token::Lt) { let span = self.prev_span.between(self.token.span); self.struct_span_err(span, "missing trait in a trait impl").emit(); - P(Ty { node: TyKind::Path(None, err_path(span)), span, id: DUMMY_NODE_ID }) + P(Ty { kind: TyKind::Path(None, err_path(span)), span, id: DUMMY_NODE_ID }) } else { self.parse_ty()? }; @@ -715,7 +715,7 @@ impl<'a> Parser<'a> { } let ty_first = ty_first.into_inner(); - let path = match ty_first.node { + let path = match ty_first.kind { // This notably includes paths passed through `ty` macro fragments (#46438). TyKind::Path(None, path) => path, _ => { @@ -1526,7 +1526,7 @@ impl<'a> Parser<'a> { // The user intended that the type be inferred, // so treat this as if the user wrote e.g. `const A: _ = expr;`. P(Ty { - node: TyKind::Infer, + kind: TyKind::Infer, span: id.span, id: ast::DUMMY_NODE_ID, }) diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index 5697edd8e48..b4c006ca2b1 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -55,7 +55,7 @@ impl<'a> Parser<'a> { let lo = self.token.span; let mut impl_dyn_multi = false; - let node = if self.eat(&token::OpenDelim(token::Paren)) { + let kind = if self.eat(&token::OpenDelim(token::Paren)) { // `(TYPE)` is a parenthesized type. // `(TYPE,)` is a tuple with a single field of type TYPE. let mut ts = vec![]; @@ -75,7 +75,7 @@ impl<'a> Parser<'a> { if ts.len() == 1 && !last_comma { let ty = ts.into_iter().nth(0).unwrap().into_inner(); let maybe_bounds = allow_plus && self.token.is_like_plus(); - match ty.node { + match ty.kind { // `(TY_BOUND_NOPAREN) + BOUND + ...`. TyKind::Path(None, ref path) if maybe_bounds => { self.parse_remaining_bounds(Vec::new(), path.clone(), lo, true)? @@ -211,7 +211,7 @@ impl<'a> Parser<'a> { }; let span = lo.to(self.prev_span); - let ty = P(Ty { node, span, id: ast::DUMMY_NODE_ID }); + let ty = P(Ty { kind, span, id: ast::DUMMY_NODE_ID }); // Try to recover from use of `+` with incorrect priority. self.maybe_report_ambiguous_plus(allow_plus, impl_dyn_multi, &ty); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 50e45184427..7eaaab9e70d 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -966,7 +966,7 @@ impl<'a> State<'a> { crate fn print_type(&mut self, ty: &ast::Ty) { self.maybe_print_comment(ty.span.lo()); self.ibox(0); - match ty.node { + match ty.kind { ast::TyKind::Slice(ref ty) => { self.s.word("["); self.print_type(ty); @@ -2760,7 +2760,7 @@ impl<'a> State<'a> { self.print_outer_attributes_inline(&input.attrs); - match input.ty.node { + match input.ty.kind { ast::TyKind::Infer if is_closure => self.print_pat(&input.pat), _ => { if let Some(eself) = input.to_self() { diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 54566b3e038..16616cf3185 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -333,7 +333,7 @@ pub fn walk_field_pattern<'a, V: Visitor<'a>>(visitor: &mut V, fp: &'a FieldPat) } pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) { - match typ.node { + match typ.kind { TyKind::Slice(ref ty) | TyKind::Paren(ref ty) => { visitor.visit_ty(ty) } |
