Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use an allocation for ItemId in StmtKind #58528

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,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)
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4663,7 +4663,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,
}
})
Expand Down Expand Up @@ -4693,7 +4693,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,
}
})
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,9 @@ impl fmt::Debug for Stmt {
pub enum StmtKind {
/// A local (`let`) binding.
Local(P<Local>),

/// An item binding.
Item(P<ItemId>),
Item(ItemId),

/// An expression without a trailing semi-colon (must have unit type).
Expr(P<Expr>),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down