Skip to content

Commit 21bf983

Browse files
committed
Rename Stmt.node to Stmt.kind
1 parent c3d8791 commit 21bf983

File tree

32 files changed

+76
-76
lines changed

32 files changed

+76
-76
lines changed

src/librustc/hir/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl CheckAttrVisitor<'tcx> {
262262

263263
fn check_stmt_attributes(&self, stmt: &hir::Stmt) {
264264
// When checking statements ignore expressions, they will be checked later
265-
if let hir::StmtKind::Local(ref l) = stmt.node {
265+
if let hir::StmtKind::Local(ref l) = stmt.kind {
266266
for attr in l.attrs.iter() {
267267
if attr.check_name(sym::inline) {
268268
self.check_inline(attr, &stmt.span, Target::Statement);

src/librustc/hir/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ pub fn walk_block<'v, V: Visitor<'v>>(visitor: &mut V, block: &'v Block) {
974974

975975
pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt) {
976976
visitor.visit_id(statement.hir_id);
977-
match statement.node {
977+
match statement.kind {
978978
StmtKind::Local(ref local) => visitor.visit_local(local),
979979
StmtKind::Item(item) => visitor.visit_nested_item(item),
980980
StmtKind::Expr(ref expression) |

src/librustc/hir/lowering.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,7 +2660,7 @@ impl<'a> LoweringContext<'a> {
26602660

26612661
for (index, stmt) in b.stmts.iter().enumerate() {
26622662
if index == b.stmts.len() - 1 {
2663-
if let StmtKind::Expr(ref e) = stmt.node {
2663+
if let StmtKind::Expr(ref e) = stmt.kind {
26642664
expr = Some(P(self.lower_expr(e)));
26652665
} else {
26662666
stmts.extend(self.lower_stmt(stmt));
@@ -2931,7 +2931,7 @@ impl<'a> LoweringContext<'a> {
29312931
}
29322932

29332933
fn lower_stmt(&mut self, s: &Stmt) -> SmallVec<[hir::Stmt; 1]> {
2934-
let node = match s.node {
2934+
let kind = match s.kind {
29352935
StmtKind::Local(ref l) => {
29362936
let (l, item_ids) = self.lower_local(l);
29372937
let mut ids: SmallVec<[hir::Stmt; 1]> = item_ids
@@ -2944,7 +2944,7 @@ impl<'a> LoweringContext<'a> {
29442944
ids.push({
29452945
hir::Stmt {
29462946
hir_id: self.lower_node_id(s.id),
2947-
node: hir::StmtKind::Local(P(l)),
2947+
kind: hir::StmtKind::Local(P(l)),
29482948
span: s.span,
29492949
}
29502950
});
@@ -2962,7 +2962,7 @@ impl<'a> LoweringContext<'a> {
29622962

29632963
hir::Stmt {
29642964
hir_id,
2965-
node: hir::StmtKind::Item(item_id),
2965+
kind: hir::StmtKind::Item(item_id),
29662966
span: s.span,
29672967
}
29682968
})
@@ -2974,7 +2974,7 @@ impl<'a> LoweringContext<'a> {
29742974
};
29752975
smallvec![hir::Stmt {
29762976
hir_id: self.lower_node_id(s.id),
2977-
node,
2977+
kind,
29782978
span: s.span,
29792979
}]
29802980
}
@@ -3011,8 +3011,8 @@ impl<'a> LoweringContext<'a> {
30113011

30123012
// Helper methods for building HIR.
30133013

3014-
fn stmt(&mut self, span: Span, node: hir::StmtKind) -> hir::Stmt {
3015-
hir::Stmt { span, node, hir_id: self.next_id() }
3014+
fn stmt(&mut self, span: Span, kind: hir::StmtKind) -> hir::Stmt {
3015+
hir::Stmt { span, kind, hir_id: self.next_id() }
30163016
}
30173017

30183018
fn stmt_expr(&mut self, span: Span, expr: hir::Expr) -> hir::Stmt {

src/librustc/hir/map/def_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
303303
}
304304

305305
fn visit_stmt(&mut self, stmt: &'a Stmt) {
306-
match stmt.node {
306+
match stmt.kind {
307307
StmtKind::Mac(..) => self.visit_macro_invoc(stmt.id),
308308
_ => visit::walk_stmt(self, stmt),
309309
}

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ impl<'hir> Map<'hir> {
968968
Some(Node::Variant(ref v)) => Some(&v.attrs[..]),
969969
Some(Node::Field(ref f)) => Some(&f.attrs[..]),
970970
Some(Node::Expr(ref e)) => Some(&*e.attrs),
971-
Some(Node::Stmt(ref s)) => Some(s.node.attrs()),
971+
Some(Node::Stmt(ref s)) => Some(s.kind.attrs()),
972972
Some(Node::Arm(ref a)) => Some(&*a.attrs),
973973
Some(Node::GenericParam(param)) => Some(&param.attrs[..]),
974974
// Unit/tuple structs/variants take the attributes straight from

src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ impl UnOp {
12211221
#[derive(RustcEncodable, RustcDecodable)]
12221222
pub struct Stmt {
12231223
pub hir_id: HirId,
1224-
pub node: StmtKind,
1224+
pub kind: StmtKind,
12251225
pub span: Span,
12261226
}
12271227

src/librustc/hir/print.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ impl<'a> State<'a> {
944944

945945
pub fn print_stmt(&mut self, st: &hir::Stmt) {
946946
self.maybe_print_comment(st.span.lo());
947-
match st.node {
947+
match st.kind {
948948
hir::StmtKind::Local(ref loc) => {
949949
self.print_local(loc.init.as_deref(), |this| this.print_local_decl(&loc));
950950
}
@@ -961,7 +961,7 @@ impl<'a> State<'a> {
961961
self.s.word(";");
962962
}
963963
}
964-
if stmt_ends_with_semi(&st.node) {
964+
if stmt_ends_with_semi(&st.kind) {
965965
self.s.word(";");
966966
}
967967
self.maybe_print_trailing_comment(st.span, None)

src/librustc/ich/impls_hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl_stable_hash_for_spanned!(hir::BinOpKind);
158158

159159
impl_stable_hash_for!(struct hir::Stmt {
160160
hir_id,
161-
node,
161+
kind,
162162
span,
163163
});
164164

src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
590590
}
591591

592592
fn walk_stmt(&mut self, stmt: &hir::Stmt) {
593-
match stmt.node {
593+
match stmt.kind {
594594
hir::StmtKind::Local(ref local) => {
595595
self.walk_local(&local);
596596
}

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
947947

948948
fn propagate_through_stmt(&mut self, stmt: &hir::Stmt, succ: LiveNode)
949949
-> LiveNode {
950-
match stmt.node {
950+
match stmt.kind {
951951
hir::StmtKind::Local(ref local) => {
952952
// Note: we mark the variable as defined regardless of whether
953953
// there is an initializer. Initially I had thought to only mark

0 commit comments

Comments
 (0)