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:
parent
e544947278
commit
5d65e8cc7a
4 changed files with 23 additions and 10 deletions
|
|
@ -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),
|
||||
..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue