diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 94b036fded5a..4a2bc213fea8 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -953,7 +953,7 @@ pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt) { visitor.visit_id(statement.id); match statement.node { StmtKind::Local(ref local) => visitor.visit_local(local), - StmtKind::Item(ref item) => visitor.visit_nested_item(**item), + StmtKind::Item(item) => visitor.visit_nested_item(item), StmtKind::Expr(ref expression) | StmtKind::Semi(ref expression) => { visitor.visit_expr(expression) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 52c3eb26d618..9f48a628274d 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -4656,7 +4656,7 @@ impl<'a> LoweringContext<'a> { hir::Stmt { id: node_id, hir_id, - node: hir::StmtKind::Item(P(item_id)), + node: hir::StmtKind::Item(item_id), span: s.span, } }) @@ -4686,7 +4686,7 @@ impl<'a> LoweringContext<'a> { hir::Stmt { id: node_id, hir_id, - node: hir::StmtKind::Item(P(item_id)), + node: hir::StmtKind::Item(item_id), span: s.span, } }) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index d7d56ef659af..deb2eb33b0f0 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1175,8 +1175,9 @@ impl fmt::Debug for Stmt { pub enum StmtKind { /// A local (`let`) binding. Local(P), + /// An item binding. - Item(P), + Item(ItemId), /// An expression without a trailing semi-colon (must have unit type). Expr(P), diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 031b3a3233d6..ece649cf1b88 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -1007,8 +1007,8 @@ impl<'a> State<'a> { } self.end()? } - hir::StmtKind::Item(ref item) => { - self.ann.nested(self, Nested::Item(**item))? + hir::StmtKind::Item(item) => { + self.ann.nested(self, Nested::Item(item))? } hir::StmtKind::Expr(ref expr) => { self.space_if_not_bol()?;