about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-09-26 18:04:05 +0100
committervarkor <github@varkor.com>2019-09-26 18:21:48 +0100
commit38121173e27d304366c6fd422318e1e424941b7c (patch)
tree9016704208a96e5da5e8918388f512ba5f03a638 /src/libsyntax
parentb4748679611c97c09cfb7096917d7830c410a4ad (diff)
downloadrust-38121173e27d304366c6fd422318e1e424941b7c.tar.gz
rust-38121173e27d304366c6fd422318e1e424941b7c.zip
Rename `MetaItem.node` to `MetaItem.kind`
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs2
-rw-r--r--src/libsyntax/attr/builtin.rs14
-rw-r--r--src/libsyntax/attr/mod.rs36
-rw-r--r--src/libsyntax/ext/expand.rs4
-rw-r--r--src/libsyntax/mut_visit.rs4
-rw-r--r--src/libsyntax/parse/attr.rs6
-rw-r--r--src/libsyntax/parse/parser/path.rs2
-rw-r--r--src/libsyntax/print/pprust.rs2
8 files changed, 35 insertions, 35 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 05ac90999af..a7f035dc9ec 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -472,7 +472,7 @@ pub enum NestedMetaItem {
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct MetaItem {
     pub path: Path,
-    pub node: MetaItemKind,
+    pub kind: MetaItemKind,
     pub span: Span,
 }
 
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs
index ca314642d62..2a8e6b2cc95 100644
--- a/src/libsyntax/attr/builtin.rs
+++ b/src/libsyntax/attr/builtin.rs
@@ -106,7 +106,7 @@ pub fn find_unwind_attr(diagnostic: Option<&Handler>, attrs: &[Attribute]) -> Op
     attrs.iter().fold(None, |ia, attr| {
         if attr.check_name(sym::unwind) {
             if let Some(meta) = attr.meta() {
-                if let MetaItemKind::List(items) = meta.node {
+                if let MetaItemKind::List(items) = meta.kind {
                     if items.len() == 1 {
                         if items[0].check_name(sym::allowed) {
                             return Some(UnwindAttr::Allowed);
@@ -239,7 +239,7 @@ fn find_stability_generic<'a, I>(sess: &ParseSess,
             allow_const_fn_ptr = true;
         }
         // attributes with data
-        else if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta {
+        else if let Some(MetaItem { kind: MetaItemKind::List(ref metas), .. }) = meta {
             let meta = meta.as_ref().unwrap();
             let get = |meta: &MetaItem, item: &mut Option<Symbol>| {
                 if item.is_some() {
@@ -534,7 +534,7 @@ pub fn cfg_matches(cfg: &ast::MetaItem, sess: &ParseSess, features: Option<&Feat
         if cfg.path.segments.len() != 1 {
             return error(cfg.path.span, "`cfg` predicate key must be an identifier");
         }
-        match &cfg.node {
+        match &cfg.kind {
             MetaItemKind::List(..) => {
                 error(cfg.span, "unexpected parentheses after `cfg` predicate key")
             }
@@ -563,7 +563,7 @@ pub fn eval_condition<F>(cfg: &ast::MetaItem, sess: &ParseSess, eval: &mut F)
                          -> bool
     where F: FnMut(&ast::MetaItem) -> bool
 {
-    match cfg.node {
+    match cfg.kind {
         ast::MetaItemKind::List(ref mis) => {
             for mi in mis.iter() {
                 if !mi.is_meta_item() {
@@ -642,7 +642,7 @@ fn find_deprecation_generic<'a, I>(sess: &ParseSess,
         }
 
         let meta = attr.meta().unwrap();
-        depr = match &meta.node {
+        depr = match &meta.kind {
             MetaItemKind::Word => Some(Deprecation { since: None, note: None }),
             MetaItemKind::NameValue(..) => {
                 meta.value_str().map(|note| {
@@ -830,7 +830,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> {
                 } else {
                     if let Some(meta_item) = item.meta_item() {
                         if meta_item.check_name(sym::align) {
-                            if let MetaItemKind::NameValue(ref value) = meta_item.node {
+                            if let MetaItemKind::NameValue(ref value) = meta_item.kind {
                                 recognised = true;
                                 let mut err = struct_span_err!(diagnostic, item.span(), E0693,
                                     "incorrect `repr(align)` attribute format");
@@ -941,7 +941,7 @@ crate fn check_builtin_attribute(
                              name == sym::test || name == sym::bench;
 
     match attr.parse_meta(sess) {
-        Ok(meta) => if !should_skip(name) && !template.compatible(&meta.node) {
+        Ok(meta) => if !should_skip(name) && !template.compatible(&meta.kind) {
             let error_msg = format!("malformed `{}` attribute input", name);
             let mut msg = "attribute must be of the form ".to_owned();
             let mut suggestions = vec![];
diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs
index 91bd0f29762..122cb7fb12b 100644
--- a/src/libsyntax/attr/mod.rs
+++ b/src/libsyntax/attr/mod.rs
@@ -174,7 +174,7 @@ impl Attribute {
 
     pub fn meta_item_list(&self) -> Option<Vec<NestedMetaItem>> {
         match self.meta() {
-            Some(MetaItem { node: MetaItemKind::List(list), .. }) => Some(list),
+            Some(MetaItem { kind: MetaItemKind::List(list), .. }) => Some(list),
             _ => None
         }
     }
@@ -210,14 +210,14 @@ impl MetaItem {
     //     #[attribute(name = "value")]
     //                 ^^^^^^^^^^^^^^
     pub fn name_value_literal(&self) -> Option<&Lit> {
-        match &self.node {
+        match &self.kind {
             MetaItemKind::NameValue(v) => Some(v),
             _ => None,
         }
     }
 
     pub fn value_str(&self) -> Option<Symbol> {
-        match self.node {
+        match self.kind {
             MetaItemKind::NameValue(ref v) => {
                 match v.kind {
                     LitKind::Str(ref s, _) => Some(*s),
@@ -229,14 +229,14 @@ impl MetaItem {
     }
 
     pub fn meta_item_list(&self) -> Option<&[NestedMetaItem]> {
-        match self.node {
+        match self.kind {
             MetaItemKind::List(ref l) => Some(&l[..]),
             _ => None
         }
     }
 
     pub fn is_word(&self) -> bool {
-        match self.node {
+        match self.kind {
             MetaItemKind::Word => true,
             _ => false,
         }
@@ -261,11 +261,11 @@ impl Attribute {
         let mut tokens = self.tokens.trees().peekable();
         Some(MetaItem {
             path: self.path.clone(),
-            node: if let Some(node) = MetaItemKind::from_tokens(&mut tokens) {
+            kind: if let Some(kind) = MetaItemKind::from_tokens(&mut tokens) {
                 if tokens.peek().is_some() {
                     return None;
                 }
-                node
+                kind
             } else {
                 return None;
             },
@@ -314,7 +314,7 @@ impl Attribute {
     pub fn parse_meta<'a>(&self, sess: &'a ParseSess) -> PResult<'a, MetaItem> {
         Ok(MetaItem {
             path: self.path.clone(),
-            node: self.parse(sess, |parser| parser.parse_meta_item_kind())?,
+            kind: self.parse(sess, |parser| parser.parse_meta_item_kind())?,
             span: self.span,
         })
     }
@@ -336,7 +336,7 @@ impl Attribute {
                 id: self.id,
                 style: self.style,
                 path: meta.path,
-                tokens: meta.node.tokens(meta.span),
+                tokens: meta.kind.tokens(meta.span),
                 is_sugared_doc: true,
                 span: self.span,
             })
@@ -356,15 +356,15 @@ pub fn mk_name_value_item_str(ident: Ident, str: Symbol, str_span: Span) -> Meta
 pub fn mk_name_value_item(ident: Ident, lit_kind: LitKind, lit_span: Span) -> MetaItem {
     let lit = Lit::from_lit_kind(lit_kind, lit_span);
     let span = ident.span.to(lit_span);
-    MetaItem { path: Path::from_ident(ident), span, node: MetaItemKind::NameValue(lit) }
+    MetaItem { path: Path::from_ident(ident), span, kind: MetaItemKind::NameValue(lit) }
 }
 
 pub fn mk_list_item(ident: Ident, items: Vec<NestedMetaItem>) -> MetaItem {
-    MetaItem { path: Path::from_ident(ident), span: ident.span, node: MetaItemKind::List(items) }
+    MetaItem { path: Path::from_ident(ident), span: ident.span, kind: MetaItemKind::List(items) }
 }
 
 pub fn mk_word_item(ident: Ident) -> MetaItem {
-    MetaItem { path: Path::from_ident(ident), span: ident.span, node: MetaItemKind::Word }
+    MetaItem { path: Path::from_ident(ident), span: ident.span, kind: MetaItemKind::Word }
 }
 
 pub fn mk_nested_word_item(ident: Ident) -> NestedMetaItem {
@@ -395,12 +395,12 @@ pub fn mk_attr(style: AttrStyle, path: Path, tokens: TokenStream, span: Span) ->
 
 /// Returns an inner attribute with the given value and span.
 pub fn mk_attr_inner(item: MetaItem) -> Attribute {
-    mk_attr(AttrStyle::Inner, item.path, item.node.tokens(item.span), item.span)
+    mk_attr(AttrStyle::Inner, item.path, item.kind.tokens(item.span), item.span)
 }
 
 /// Returns an outer attribute with the given value and span.
 pub fn mk_attr_outer(item: MetaItem) -> Attribute {
-    mk_attr(AttrStyle::Outer, item.path, item.node.tokens(item.span), item.span)
+    mk_attr(AttrStyle::Outer, item.path, item.kind.tokens(item.span), item.span)
 }
 
 pub fn mk_sugared_doc_attr(text: Symbol, span: Span) -> Attribute {
@@ -483,7 +483,7 @@ impl MetaItem {
             idents.push(TokenTree::Token(Token::from_ast_ident(segment.ident)).into());
             last_pos = segment.ident.span.hi();
         }
-        self.node.tokens(self.span).append_to_tree_and_joint_vec(&mut idents);
+        self.kind.tokens(self.span).append_to_tree_and_joint_vec(&mut idents);
         TokenStream::new(idents)
     }
 
@@ -531,14 +531,14 @@ impl MetaItem {
             _ => return None,
         };
         let list_closing_paren_pos = tokens.peek().map(|tt| tt.span().hi());
-        let node = MetaItemKind::from_tokens(tokens)?;
-        let hi = match node {
+        let kind = MetaItemKind::from_tokens(tokens)?;
+        let hi = match kind {
             MetaItemKind::NameValue(ref lit) => lit.span.hi(),
             MetaItemKind::List(..) => list_closing_paren_pos.unwrap_or(path.span.hi()),
             _ => path.span.hi(),
         };
         let span = path.span.with_hi(hi);
-        Some(MetaItem { path, node, span })
+        Some(MetaItem { path, kind, span })
     }
 }
 
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index aa813c03c36..02e7c6775a4 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -659,7 +659,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
                     if !item.derive_allowed() {
                         return fragment_kind.dummy(span);
                     }
-                    let meta = ast::MetaItem { node: ast::MetaItemKind::Word, span, path };
+                    let meta = ast::MetaItem { kind: ast::MetaItemKind::Word, span, path };
                     let items = expander.expand(self.cx, span, &meta, item);
                     fragment_kind.expect_from_annotatables(items)
                 }
@@ -1534,7 +1534,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
                 id: at.id,
                 style: at.style,
                 path: meta.path,
-                tokens: meta.node.tokens(meta.span),
+                tokens: meta.kind.tokens(meta.span),
                 is_sugared_doc: false,
             };
         } else {
diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs
index ec4ab02444f..43b5df38e14 100644
--- a/src/libsyntax/mut_visit.rs
+++ b/src/libsyntax/mut_visit.rs
@@ -576,8 +576,8 @@ pub fn noop_visit_meta_list_item<T: MutVisitor>(li: &mut NestedMetaItem, vis: &m
 }
 
 pub fn noop_visit_meta_item<T: MutVisitor>(mi: &mut MetaItem, vis: &mut T) {
-    let MetaItem { path: _, node, span } = mi;
-    match node {
+    let MetaItem { path: _, kind, span } = mi;
+    match kind {
         MetaItemKind::Word => {}
         MetaItemKind::List(mis) => visit_vec(mis, |mi| vis.visit_meta_list_item(mi)),
         MetaItemKind::NameValue(_s) => {}
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index 4b2c329625b..44688bd36b5 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -179,7 +179,7 @@ impl<'a> Parser<'a> {
         };
         Ok(if let Some(meta) = meta {
             self.bump();
-            (meta.path, meta.node.tokens(meta.span))
+            (meta.path, meta.kind.tokens(meta.span))
         } else {
             let path = self.parse_path(PathStyle::Mod)?;
             let tokens = if self.check(&token::OpenDelim(DelimToken::Paren)) ||
@@ -281,9 +281,9 @@ impl<'a> Parser<'a> {
 
         let lo = self.token.span;
         let path = self.parse_path(PathStyle::Mod)?;
-        let node = self.parse_meta_item_kind()?;
+        let kind = self.parse_meta_item_kind()?;
         let span = lo.to(self.prev_span);
-        Ok(ast::MetaItem { path, node, span })
+        Ok(ast::MetaItem { path, kind, span })
     }
 
     crate fn parse_meta_item_kind(&mut self) -> PResult<'a, ast::MetaItemKind> {
diff --git a/src/libsyntax/parse/parser/path.rs b/src/libsyntax/parse/parser/path.rs
index 87839f8c70e..463ae9124ca 100644
--- a/src/libsyntax/parse/parser/path.rs
+++ b/src/libsyntax/parse/parser/path.rs
@@ -114,7 +114,7 @@ impl<'a> Parser<'a> {
     pub fn parse_path_allowing_meta(&mut self, style: PathStyle) -> PResult<'a, Path> {
         let meta_ident = match self.token.kind {
             token::Interpolated(ref nt) => match **nt {
-                token::NtMeta(ref meta) => match meta.node {
+                token::NtMeta(ref meta) => match meta.kind {
                     ast::MetaItemKind::Word => Some(meta.path.clone()),
                     _ => None,
                 },
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 3cf5e4a248c..a5792dab474 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -662,7 +662,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
 
     fn print_meta_item(&mut self, item: &ast::MetaItem) {
         self.ibox(INDENT_UNIT);
-        match item.node {
+        match item.kind {
             ast::MetaItemKind::Word => self.print_path(&item.path, false, 0),
             ast::MetaItemKind::NameValue(ref value) => {
                 self.print_path(&item.path, false, 0);