Skip to content

Commit 17726f6

Browse files
committed
Rename Lit.node to Lit.kind
1 parent ce6aabb commit 17726f6

File tree

17 files changed

+25
-25
lines changed

17 files changed

+25
-25
lines changed

src/librustc/hir/lowering/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl LoweringContext<'_> {
5454
let ohs = P(self.lower_expr(ohs));
5555
hir::ExprKind::Unary(op, ohs)
5656
}
57-
ExprKind::Lit(ref l) => hir::ExprKind::Lit(respan(l.span, l.node.clone())),
57+
ExprKind::Lit(ref l) => hir::ExprKind::Lit(respan(l.span, l.kind.clone())),
5858
ExprKind::Cast(ref expr, ref ty) => {
5959
let expr = P(self.lower_expr(expr));
6060
hir::ExprKind::Cast(expr, self.lower_ty(ty, ImplTraitContext::disallowed()))

src/librustc/ich/impls_syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl_stable_hash_for!(enum ::syntax::ast::LitIntType {
142142
});
143143

144144
impl_stable_hash_for!(struct ::syntax::ast::Lit {
145-
node,
145+
kind,
146146
token,
147147
span
148148
});

src/librustc/lint/levels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ impl<'a> LintLevelsBuilder<'a> {
226226
metas = &metas[0..metas.len()-1];
227227
// FIXME (#55112): issue unused-attributes lint if we thereby
228228
// don't have any lint names (`#[level(reason = "foo")]`)
229-
if let ast::LitKind::Str(rationale, _) = name_value.node {
229+
if let ast::LitKind::Str(rationale, _) = name_value.kind {
230230
if !self.sess.features_untracked().lint_reasons {
231231
feature_gate::emit_feature_err(
232232
&self.sess.parse_sess,

src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String
18831883
MetaItemKind::List(..) => {
18841884
error!(r#"expected `key` or `key="value"`"#);
18851885
}
1886-
MetaItemKind::NameValue(lit) if !lit.node.is_str() => {
1886+
MetaItemKind::NameValue(lit) if !lit.kind.is_str() => {
18871887
error!("argument value must be a string");
18881888
}
18891889
MetaItemKind::NameValue(..) | MetaItemKind::Word => {

src/librustc/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ impl<'tcx> TyCtxt<'tcx> {
11501150
None => return Bound::Unbounded,
11511151
};
11521152
for meta in attr.meta_item_list().expect("rustc_layout_scalar_valid_range takes args") {
1153-
match meta.literal().expect("attribute takes lit").node {
1153+
match meta.literal().expect("attribute takes lit").kind {
11541154
ast::LitKind::Int(a, _) => return Bound::Included(a),
11551155
_ => span_bug!(attr.span, "rustc_layout_scalar_valid_range expects int arg"),
11561156
}

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl EarlyLintPass for WhileTrue {
7777
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
7878
if let ast::ExprKind::While(cond, ..) = &e.kind {
7979
if let ast::ExprKind::Lit(ref lit) = pierce_parens(cond).kind {
80-
if let ast::LitKind::Bool(true) = lit.node {
80+
if let ast::LitKind::Bool(true) = lit.kind {
8181
if !lit.span.from_expansion() {
8282
let msg = "denote infinite loops with `loop { ... }`";
8383
let condition_span = cx.sess.source_map().def_span(e.span);

src/librustc_lint/nonstandard_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonSnakeCase {
258258
.and_then(|attr| attr.meta())
259259
.and_then(|meta| {
260260
meta.name_value_literal().and_then(|lit| {
261-
if let ast::LitKind::Str(name, ..) = lit.node {
261+
if let ast::LitKind::Str(name, ..) = lit.kind {
262262
// Discard the double quotes surrounding the literal.
263263
let sp = cx.sess().source_map().span_to_snippet(lit.span)
264264
.ok()

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ fn args_required_const(tcx: TyCtxt<'_>, def_id: DefId) -> Option<FxHashSet<usize
17681768
let attr = attrs.iter().find(|a| a.check_name(sym::rustc_args_required_const))?;
17691769
let mut ret = FxHashSet::default();
17701770
for meta in attr.meta_item_list()? {
1771-
match meta.literal()?.node {
1771+
match meta.literal()?.kind {
17721772
LitKind::Int(a, _) => { ret.insert(a as usize); }
17731773
_ => return None,
17741774
}

src/librustdoc/clean/cfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl Cfg {
7070
};
7171
match cfg.node {
7272
MetaItemKind::Word => Ok(Cfg::Cfg(name, None)),
73-
MetaItemKind::NameValue(ref lit) => match lit.node {
73+
MetaItemKind::NameValue(ref lit) => match lit.kind {
7474
LitKind::Str(value, _) => Ok(Cfg::Cfg(name, Some(value))),
7575
_ => Err(InvalidCfgError {
7676
// FIXME: if the main #[cfg] syntax decided to support non-string literals,

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ pub struct Lit {
13611361
/// The "semantic" representation of the literal lowered from the original tokens.
13621362
/// Strings are unescaped, hexadecimal forms are eliminated, etc.
13631363
/// FIXME: Remove this and only create the semantic representation during lowering to HIR.
1364-
pub node: LitKind,
1364+
pub kind: LitKind,
13651365
pub span: Span,
13661366
}
13671367

0 commit comments

Comments
 (0)