From 61df8ec4b80f96d2b65e02647037716255f77992 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 24 Apr 2025 09:55:06 +0200 Subject: [PATCH] Arena allocate `LifetimeRef`s --- crates/hir-def/src/expr_store.rs | 26 +++++++++- crates/hir-def/src/expr_store/lower.rs | 52 +++++++++++++------ .../hir-def/src/expr_store/lower/generics.rs | 16 +++--- crates/hir-def/src/expr_store/path.rs | 4 +- crates/hir-def/src/expr_store/pretty.rs | 24 +++++---- crates/hir-def/src/hir/generics.rs | 4 +- crates/hir-def/src/hir/type_ref.rs | 19 ++++--- crates/hir-def/src/resolver.rs | 3 ++ crates/hir-ty/src/display.rs | 18 +++++-- crates/hir-ty/src/infer.rs | 4 +- crates/hir-ty/src/infer/expr.rs | 2 +- crates/hir-ty/src/lower.rs | 12 ++--- crates/hir-ty/src/lower/path.rs | 2 +- 13 files changed, 126 insertions(+), 60 deletions(-) diff --git a/crates/hir-def/src/expr_store.rs b/crates/hir-def/src/expr_store.rs index 3141fceeb0..e3775c4931 100644 --- a/crates/hir-def/src/expr_store.rs +++ b/crates/hir-def/src/expr_store.rs @@ -31,7 +31,7 @@ use crate::{ PatId, RecordFieldPat, Statement, }, nameres::DefMap, - type_ref::{PathId, TypeRef, TypeRefId}, + type_ref::{LifetimeRef, LifetimeRefId, PathId, TypeRef, TypeRefId}, }; pub use self::body::{Body, BodySourceMap}; @@ -87,6 +87,9 @@ pub type MacroCallPtr = AstPtr; pub type TypePtr = AstPtr; pub type TypeSource = InFile; +pub type LifetimePtr = AstPtr; +pub type LifetimeSource = InFile; + #[derive(Debug, Eq, PartialEq)] pub struct ExpressionStore { pub exprs: Arena, @@ -94,6 +97,7 @@ pub struct ExpressionStore { pub bindings: Arena, pub labels: Arena