about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-09-01 12:06:48 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-09-08 15:07:19 +1000
commit977b6e29a345ee43acabd2e1a7eb8e454626e2f3 (patch)
treede557fefedfa8780d4d1f8b8430b363631a5230e
parent567e1bbca7942c1f5353ca0b3b94210e4fc417c0 (diff)
downloadrust-977b6e29a345ee43acabd2e1a7eb8e454626e2f3.tar.gz
rust-977b6e29a345ee43acabd2e1a7eb8e454626e2f3.zip
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.
-rw-r--r--clippy_utils/src/hir_utils.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/hir_utils.rs b/clippy_utils/src/hir_utils.rs
index 57448f716d4..ff23ed5fffa 100644
--- a/clippy_utils/src/hir_utils.rs
+++ b/clippy_utils/src/hir_utils.rs
@@ -929,7 +929,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
         }
     }
 
-    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);