Reduce the size of hir::Expr.

From 104 bytes to 72 bytes on x86-64. This slightly reduces instruction
counts.

Also add an assertion about the size.
This commit is contained in:
Nicholas Nethercote 2019-02-07 16:03:57 +11:00
parent e544947278
commit 5d65e8cc7a
4 changed files with 23 additions and 10 deletions

View file

@ -614,11 +614,16 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
Some(def) if def != HirDef::Err => def,
_ => self.get_path_def(self.tcx.hir().get_parent_node(id)),
}
},
}
Node::Expr(&hir::Expr {
node: hir::ExprKind::Struct(ref qpath, ..),
..
}) |
}) => {
let hir_id = self.tcx.hir().node_to_hir_id(id);
self.tables.qpath_def(qpath, hir_id)
}
Node::Expr(&hir::Expr {
node: hir::ExprKind::Path(ref qpath),
..