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:
Nicholas Nethercote 2022-09-01 12:06:48 +10:00
parent 567e1bbca7
commit 977b6e29a3

View File

@ -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);