Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | Cargo.lock | 44 | ||||
| -rw-r--r-- | Cargo.toml | 4 | ||||
| -rw-r--r-- | crates/hir-ty/src/builtin_derive.rs | 2 | ||||
| -rw-r--r-- | crates/hir-ty/src/consteval.rs | 8 | ||||
| -rw-r--r-- | crates/hir-ty/src/lower.rs | 36 | ||||
| -rw-r--r-- | crates/hir-ty/src/opaques.rs | 8 | ||||
| -rw-r--r-- | crates/span/src/hygiene.rs | 2 |
7 files changed, 65 insertions, 39 deletions
diff --git a/Cargo.lock b/Cargo.lock index 604bc345c4..f47bff58bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -648,6 +648,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] name = "form_urlencoded" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -734,7 +740,7 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -744,6 +750,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" [[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] + +[[package]] name = "hashlink" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1232,9 +1249,9 @@ dependencies = [ [[package]] name = "inventory" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc61209c082fbeb19919bee74b176221b27223e27b65d781eb91af24eb1fb46e" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" dependencies = [ "rustversion", ] @@ -2455,14 +2472,14 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "salsa" -version = "0.26.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77debccd43ba198e9cee23efd7f10330ff445e46a98a2b107fed9094a1ee676" +checksum = "4612ff789805e65c87e9b38cb749a293212a615af065bed8a2001086801498c3" dependencies = [ "boxcar", "crossbeam-queue", "crossbeam-utils", - "hashbrown 0.15.5", + "hashbrown 0.17.0", "hashlink", "indexmap", "intrusive-collections", @@ -2476,19 +2493,20 @@ dependencies = [ "smallvec", "thin-vec", "tracing", + "typeid", ] [[package]] name = "salsa-macro-rules" -version = "0.26.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea07adbf42d91cc076b7daf3b38bc8168c19eb362c665964118a89bc55ef19a5" +checksum = "58e354cbac6939b9b09cd9c11fb419a53e64b4a0f755d929f56a09f4cc752e41" [[package]] name = "salsa-macros" -version = "0.26.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16d4d8b66451b9c75ddf740b7fc8399bc7b8ba33e854a5d7526d18708f67b05" +checksum = "3067861075c2b80608f84ad49fb88f2c7610b94cdf8b4201e79ddee87f8980c8" dependencies = [ "proc-macro2", "quote", @@ -3111,6 +3129,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] name = "unarray" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/Cargo.toml b/Cargo.toml index b8dedc6c50..4a93c26ff7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,13 +135,13 @@ rayon = "1.10.0" rowan = "=0.15.18" # Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work # on impls without it -salsa = { version = "0.26", default-features = false, features = [ +salsa = { version = "0.26.2", default-features = false, features = [ "rayon", "salsa_unstable", "macros", "inventory", ] } -salsa-macros = "0.26" +salsa-macros = "0.26.2" semver = "1.0.26" serde = { version = "1.0.219" } serde_derive = { version = "1.0.219" } diff --git a/crates/hir-ty/src/builtin_derive.rs b/crates/hir-ty/src/builtin_derive.rs index f14e6e4e4d..73c0313823 100644 --- a/crates/hir-ty/src/builtin_derive.rs +++ b/crates/hir-ty/src/builtin_derive.rs @@ -152,7 +152,7 @@ pub fn impl_trait<'db>( } #[salsa::tracked(returns(ref))] -pub fn predicates<'db>(db: &'db dyn HirDatabase, impl_: BuiltinDeriveImplId) -> GenericPredicates { +pub fn predicates(db: &dyn HirDatabase, impl_: BuiltinDeriveImplId) -> GenericPredicates { let loc = impl_.loc(db); let generic_params = GenericParams::of(db, loc.adt.into()); let interner = DbInterner::new_with(db, loc.module(db).krate(db)); diff --git a/crates/hir-ty/src/consteval.rs b/crates/hir-ty/src/consteval.rs index 87633ad4aa..0fdd3ff1d9 100644 --- a/crates/hir-ty/src/consteval.rs +++ b/crates/hir-ty/src/consteval.rs @@ -330,8 +330,8 @@ pub(crate) fn const_eval<'db>( }; #[salsa::tracked(returns(ref), cycle_result = const_eval_cycle_result)] - pub(crate) fn const_eval_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn const_eval_query( + db: &dyn HirDatabase, def: ConstId, subst: StoredGenericArgs, trait_env: Option<StoredParamEnvAndCrate>, @@ -371,8 +371,8 @@ pub(crate) fn const_eval_static<'db>( }; #[salsa::tracked(returns(ref), cycle_result = const_eval_static_cycle_result)] - pub(crate) fn const_eval_static_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn const_eval_static_query( + db: &dyn HirDatabase, def: StaticId, ) -> Result<StoredAllocation, ConstEvalError> { let interner = DbInterner::new_no_crate(db); diff --git a/crates/hir-ty/src/lower.rs b/crates/hir-ty/src/lower.rs index 7066d40813..d3db2a9057 100644 --- a/crates/hir-ty/src/lower.rs +++ b/crates/hir-ty/src/lower.rs @@ -1153,8 +1153,8 @@ pub(crate) fn impl_trait_with_diagnostics<'db>( }); #[salsa::tracked(returns(ref))] - pub(crate) fn impl_trait_with_diagnostics_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn impl_trait_with_diagnostics_query( + db: &dyn HirDatabase, impl_id: ImplId, ) -> Option<(StoredEarlyBinder<(TraitId, StoredGenericArgs)>, Diagnostics)> { let impl_data = ImplSignature::of(db, impl_id); @@ -1441,8 +1441,8 @@ pub(crate) fn value_ty<'db>( return value_ty_query(db, def).as_ref().map(|it| it.get()); #[salsa::tracked(returns(ref))] - pub(crate) fn value_ty_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn value_ty_query( + db: &dyn HirDatabase, def: ValueTyDefId, ) -> Option<StoredEarlyBinder<StoredTy>> { match def { @@ -1464,8 +1464,8 @@ pub(crate) fn type_for_type_alias_with_diagnostics<'db>( return (ty.get(), diags.clone()); #[salsa::tracked(returns(ref), cycle_result = type_for_type_alias_with_diagnostics_cycle_result)] - pub(crate) fn type_for_type_alias_with_diagnostics_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn type_for_type_alias_with_diagnostics_query( + db: &dyn HirDatabase, t: TypeAliasId, ) -> (StoredEarlyBinder<StoredTy>, Diagnostics) { let type_alias_data = TypeAliasSignature::of(db, t); @@ -1525,8 +1525,8 @@ pub(crate) fn impl_self_ty_with_diagnostics<'db>( return (ty.get(), diags.clone()); #[salsa::tracked(returns(ref), cycle_result = impl_self_ty_with_diagnostics_cycle_result)] - pub(crate) fn impl_self_ty_with_diagnostics_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn impl_self_ty_with_diagnostics_query( + db: &dyn HirDatabase, impl_id: ImplId, ) -> (StoredEarlyBinder<StoredTy>, Diagnostics) { let resolver = impl_id.resolver(db); @@ -1572,8 +1572,8 @@ pub(crate) fn const_param_ty_with_diagnostics<'db>( // FIXME: Make this query non-interned. #[salsa::tracked(returns(ref), cycle_result = const_param_ty_with_diagnostics_cycle_result)] - pub(crate) fn const_param_ty_with_diagnostics_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn const_param_ty_with_diagnostics_query( + db: &dyn HirDatabase, _: (), def: ConstParamId, ) -> (StoredTy, Diagnostics) { @@ -1618,8 +1618,8 @@ pub(crate) fn field_types_query( /// Build the type of all specific fields of a struct or enum variant. #[salsa::tracked(returns(ref))] -pub(crate) fn field_types_with_diagnostics_query<'db>( - db: &'db dyn HirDatabase, +pub(crate) fn field_types_with_diagnostics_query( + db: &dyn HirDatabase, variant_id: VariantId, ) -> (ArenaMap<LocalFieldId, StoredEarlyBinder<StoredTy>>, Diagnostics) { let var_data = variant_id.fields(db); @@ -1940,8 +1940,8 @@ fn type_alias_bounds_with_diagnostics<'db>( ); #[salsa::tracked(returns(ref))] - pub fn type_alias_bounds_with_diagnostics_query<'db>( - db: &'db dyn HirDatabase, + pub fn type_alias_bounds_with_diagnostics_query( + db: &dyn HirDatabase, type_alias: TypeAliasId, ) -> (TypeAliasBounds<StoredEarlyBinder<StoredClauses>>, Diagnostics) { let type_alias_data = TypeAliasSignature::of(db, type_alias); @@ -2157,8 +2157,8 @@ pub(crate) fn trait_environment<'db>( return ParamEnv { clauses: trait_environment_query(db, def).as_ref() }; #[salsa::tracked(returns(ref))] - pub(crate) fn trait_environment_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn trait_environment_query( + db: &dyn HirDatabase, def: GenericDefId, ) -> StoredClauses { let module = def.module(db); @@ -2452,8 +2452,8 @@ pub(crate) fn callable_item_signature<'db>( return callable_item_signature_query(db, def).get_with(|sig| sig.get()); #[salsa::tracked(returns(ref))] - pub(crate) fn callable_item_signature_query<'db>( - db: &'db dyn HirDatabase, + pub(crate) fn callable_item_signature_query( + db: &dyn HirDatabase, def: CallableDefId, ) -> StoredEarlyBinder<StoredPolyFnSig> { match def { diff --git a/crates/hir-ty/src/opaques.rs b/crates/hir-ty/src/opaques.rs index c78e9d7c5d..699b6307dc 100644 --- a/crates/hir-ty/src/opaques.rs +++ b/crates/hir-ty/src/opaques.rs @@ -91,8 +91,8 @@ pub(crate) fn opaque_types_defined_by( // These are firewall queries to prevent drawing dependencies between infers: #[salsa::tracked(returns(ref))] -pub(crate) fn rpit_hidden_types<'db>( - db: &'db dyn HirDatabase, +pub(crate) fn rpit_hidden_types( + db: &dyn HirDatabase, function: FunctionId, ) -> ArenaMap<ImplTraitIdx, StoredEarlyBinder<StoredTy>> { let infer = InferenceResult::of(db, DefWithBodyId::from(function)); @@ -105,8 +105,8 @@ pub(crate) fn rpit_hidden_types<'db>( } #[salsa::tracked(returns(ref))] -pub(crate) fn tait_hidden_types<'db>( - db: &'db dyn HirDatabase, +pub(crate) fn tait_hidden_types( + db: &dyn HirDatabase, type_alias: TypeAliasId, ) -> ArenaMap<ImplTraitIdx, StoredEarlyBinder<StoredTy>> { // Call this first, to not perform redundant work if there are no TAITs. diff --git a/crates/span/src/hygiene.rs b/crates/span/src/hygiene.rs index 0a81cef52e..f475de93e0 100644 --- a/crates/span/src/hygiene.rs +++ b/crates/span/src/hygiene.rs @@ -156,6 +156,8 @@ const _: () = { impl zalsa_::SalsaStructInDb for SyntaxContext { type MemoIngredientMap = salsa::plumbing::MemoIngredientSingletonIndex; + const LEAF_TYPE_IDS: &[salsa::plumbing::ConstTypeId] = + &[salsa::plumbing::ConstTypeId::of::<SyntaxContext>()]; fn lookup_ingredient_index(aux: &zalsa_::Zalsa) -> salsa::plumbing::IngredientIndices { aux.lookup_jar_by_type::<zalsa_struct_::JarImpl<SyntaxContext>>().into() |