Skip to content

Commit 3812117

Browse files
committed
Rename MetaItem.node to MetaItem.kind
1 parent b474867 commit 3812117

File tree

19 files changed

+50
-50
lines changed

19 files changed

+50
-50
lines changed

src/librustc/ich/impls_syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl_stable_hash_for!(enum ::syntax::ast::NestedMetaItem {
361361

362362
impl_stable_hash_for!(struct ::syntax::ast::MetaItem {
363363
path,
364-
node,
364+
kind,
365365
span
366366
});
367367

src/librustc/lint/levels.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'a> LintLevelsBuilder<'a> {
218218
let mut reason = None;
219219
let tail_li = &metas[metas.len()-1];
220220
if let Some(item) = tail_li.meta_item() {
221-
match item.node {
221+
match item.kind {
222222
ast::MetaItemKind::Word => {} // actual lint names handled later
223223
ast::MetaItemKind::NameValue(ref name_value) => {
224224
if item.path == sym::reason {
@@ -264,7 +264,7 @@ impl<'a> LintLevelsBuilder<'a> {
264264
let mut err = bad_attr(sp);
265265
let mut add_label = true;
266266
if let Some(item) = li.meta_item() {
267-
if let ast::MetaItemKind::NameValue(_) = item.node {
267+
if let ast::MetaItemKind::NameValue(_) = item.kind {
268268
if item.path == sym::reason {
269269
err.span_label(sp, "reason in lint attribute must come last");
270270
add_label = false;

src/librustc/middle/lib_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl LibFeatureCollector<'tcx> {
5959
attr.check_name(**stab_attr)
6060
}) {
6161
let meta_item = attr.meta();
62-
if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta_item {
62+
if let Some(MetaItem { kind: MetaItemKind::List(ref metas), .. }) = meta_item {
6363
let mut feature = None;
6464
let mut since = None;
6565
for meta in metas {

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,7 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String
18791879
if meta_item.path.segments.len() != 1 {
18801880
error!("argument key must be an identifier");
18811881
}
1882-
match &meta_item.node {
1882+
match &meta_item.kind {
18831883
MetaItemKind::List(..) => {
18841884
error!(r#"expected `key` or `key="value"`"#);
18851885
}

src/librustc_driver/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ impl RustcDefaultCalls {
700700
let mut cfgs = sess.parse_sess.config.iter().filter_map(|&(name, ref value)| {
701701
let gated_cfg = GatedCfg::gate(&ast::MetaItem {
702702
path: ast::Path::from_ident(ast::Ident::with_dummy_span(name)),
703-
node: ast::MetaItemKind::Word,
703+
kind: ast::MetaItemKind::Word,
704704
span: DUMMY_SP,
705705
});
706706

src/librustc_interface/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec<c
556556
sym::bin
557557
];
558558

559-
if let ast::MetaItemKind::NameValue(spanned) = a.meta().unwrap().node {
559+
if let ast::MetaItemKind::NameValue(spanned) = a.meta().unwrap().kind {
560560
let span = spanned.span;
561561
let lev_candidate = find_best_match_for_name(
562562
crate_types.iter(),

src/librustc_resolve/build_reduced_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
944944
}
945945
let ill_formed = |span| span_err!(self.r.session, span, E0466, "bad macro import");
946946
match attr.meta() {
947-
Some(meta) => match meta.node {
947+
Some(meta) => match meta.kind {
948948
MetaItemKind::Word => {
949949
import_all = Some(meta.span);
950950
break;

src/librustc_typeck/collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
26532653
if attr.path != sym::inline {
26542654
return ia;
26552655
}
2656-
match attr.meta().map(|i| i.node) {
2656+
match attr.meta().map(|i| i.kind) {
26572657
Some(MetaItemKind::Word) => {
26582658
mark_used(attr);
26592659
InlineAttr::Hint
@@ -2694,7 +2694,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, id: DefId) -> CodegenFnAttrs {
26942694
return ia;
26952695
}
26962696
let err = |sp, s| span_err!(tcx.sess.diagnostic(), sp, E0722, "{}", s);
2697-
match attr.meta().map(|i| i.node) {
2697+
match attr.meta().map(|i| i.kind) {
26982698
Some(MetaItemKind::Word) => {
26992699
err(attr.span, "expected one argument");
27002700
ia

src/librustdoc/clean/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Cfg {
6868
span: cfg.span
6969
}),
7070
};
71-
match cfg.node {
71+
match cfg.kind {
7272
MetaItemKind::Word => Ok(Cfg::Cfg(name, None)),
7373
MetaItemKind::NameValue(ref lit) => match lit.kind {
7474
LitKind::Str(value, _) => Ok(Cfg::Cfg(name, Some(value))),

src/librustdoc/clean/cfg/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn name_value_cfg(name: &str, value: &str) -> Cfg {
1717
fn dummy_meta_item_word(name: &str) -> MetaItem {
1818
MetaItem {
1919
path: Path::from_ident(Ident::from_str(name)),
20-
node: MetaItemKind::Word,
20+
kind: MetaItemKind::Word,
2121
span: DUMMY_SP,
2222
}
2323
}
@@ -26,7 +26,7 @@ macro_rules! dummy_meta_item_list {
2626
($name:ident, [$($list:ident),* $(,)?]) => {
2727
MetaItem {
2828
path: Path::from_ident(Ident::from_str(stringify!($name))),
29-
node: MetaItemKind::List(vec![
29+
kind: MetaItemKind::List(vec![
3030
$(
3131
NestedMetaItem::MetaItem(
3232
dummy_meta_item_word(stringify!($list)),

0 commit comments

Comments
 (0)