Arena-allocate hir::Lifetime
.
This shrinks `hir::Ty` from 72 to 48 bytes. `visit_lifetime` is added to the HIR stats collector because these types are now stored in memory on their own, instead of being within other types.
This commit is contained in:
parent
567e1bbca7
commit
977b6e29a3
@ -929,7 +929,7 @@ pub fn hash_guard(&mut self, g: &Guard<'_>) {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn hash_lifetime(&mut self, lifetime: Lifetime) {
|
||||
pub fn hash_lifetime(&mut self, lifetime: &Lifetime) {
|
||||
std::mem::discriminant(&lifetime.name).hash(&mut self.s);
|
||||
if let LifetimeName::Param(param_id, ref name) = lifetime.name {
|
||||
std::mem::discriminant(name).hash(&mut self.s);
|
||||
|
Loading…
Reference in New Issue
Block a user