From aa711f622f96b74ac9e4f477884b2b018cab6c5e Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Sun, 12 Oct 2025 16:15:13 +0300 Subject: [PATCH] Make `lookup_impl_method()` query transparent The bulk of the work is trait solving and cached in the trait solver's cache, and this will save memory. --- src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs | 3 +-- src/tools/rust-analyzer/crates/hir-ty/src/db.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs b/src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs index 002e0823b9d1..761d72243e9f 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/consteval.rs @@ -5,13 +5,12 @@ mod tests; use base_db::Crate; use hir_def::{ - EnumVariantId, GeneralConstId, + EnumVariantId, GeneralConstId, HasModule, StaticId, expr_store::{Body, HygieneId, path::Path}, hir::{Expr, ExprId}, resolver::{Resolver, ValueNs}, type_ref::LiteralConstRef, }; -use hir_def::{HasModule, StaticId}; use hir_expand::Lookup; use rustc_type_ir::{UnevaluatedConst, inherent::IntoKind}; use stdx::never; diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/db.rs b/src/tools/rust-analyzer/crates/hir-ty/src/db.rs index 4b33c8a84a81..6c1d05ab1b50 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/db.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/db.rs @@ -96,6 +96,7 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug { ) -> Result>; #[salsa::invoke(crate::method_resolution::lookup_impl_method_query)] + #[salsa::transparent] fn lookup_impl_method<'db>( &'db self, env: Arc>,