diff options
| author | varkor <github@varkor.com> | 2019-09-26 16:56:53 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-09-26 18:21:09 +0100 |
| commit | 17726f6b52b68279384cfb13209f015ab491c1c0 (patch) | |
| tree | 84cc1132b9b4fbe07aee481fc026ea91e4f81683 /src/libsyntax/attr | |
| parent | ce6aabbaa19378ac621c2971934383a146176fec (diff) | |
| download | rust-17726f6b52b68279384cfb13209f015ab491c1c0.tar.gz rust-17726f6b52b68279384cfb13209f015ab491c1c0.zip | |
Rename `Lit.node` to `Lit.kind`
Diffstat (limited to 'src/libsyntax/attr')
| -rw-r--r-- | src/libsyntax/attr/builtin.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index b5037b75f79..ca314642d62 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -36,7 +36,7 @@ impl AttributeTemplate { match meta_item_kind { ast::MetaItemKind::Word => self.word, ast::MetaItemKind::List(..) => self.list.is_some(), - ast::MetaItemKind::NameValue(lit) if lit.node.is_str() => self.name_value_str.is_some(), + ast::MetaItemKind::NameValue(lit) if lit.kind.is_str() => self.name_value_str.is_some(), ast::MetaItemKind::NameValue(..) => false, } } @@ -538,13 +538,13 @@ pub fn cfg_matches(cfg: &ast::MetaItem, sess: &ParseSess, features: Option<&Feat MetaItemKind::List(..) => { error(cfg.span, "unexpected parentheses after `cfg` predicate key") } - MetaItemKind::NameValue(lit) if !lit.node.is_str() => { + MetaItemKind::NameValue(lit) if !lit.kind.is_str() => { handle_errors( sess, lit.span, AttrError::UnsupportedLiteral( "literal in `cfg` predicate value must be a string", - lit.node.is_bytestr() + lit.kind.is_bytestr() ), ); true @@ -668,7 +668,7 @@ fn find_deprecation_generic<'a, I>(sess: &ParseSess, AttrError::UnsupportedLiteral( "literal in `deprecated` \ value must be a string", - lit.node.is_bytestr() + lit.kind.is_bytestr() ), ); } else { @@ -811,14 +811,14 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> { let mut literal_error = None; if name == sym::align { recognised = true; - match parse_alignment(&value.node) { + match parse_alignment(&value.kind) { Ok(literal) => acc.push(ReprAlign(literal)), Err(message) => literal_error = Some(message) }; } else if name == sym::packed { recognised = true; - match parse_alignment(&value.node) { + match parse_alignment(&value.kind) { Ok(literal) => acc.push(ReprPacked(literal)), Err(message) => literal_error = Some(message) }; @@ -834,7 +834,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> { recognised = true; let mut err = struct_span_err!(diagnostic, item.span(), E0693, "incorrect `repr(align)` attribute format"); - match value.node { + match value.kind { ast::LitKind::Int(int, ast::LitIntType::Unsuffixed) => { err.span_suggestion( item.span(), diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index 9d06b926f97..bba7532df2e 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -219,7 +219,7 @@ impl MetaItem { pub fn value_str(&self) -> Option<Symbol> { match self.node { MetaItemKind::NameValue(ref v) => { - match v.node { + match v.kind { LitKind::Str(ref s, _) => Some(*s), _ => None, } |
