Skip to content

Commit 34fd9f6

Browse files
Merge pull request #21283 from ChayimFriedman2/upgrade-salsa
internal: Upgrade Salsa
2 parents e500b2e + 4e54d37 commit 34fd9f6

File tree

20 files changed

+42
-28
lines changed

20 files changed

+42
-28
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ rayon = "1.10.0"
135135
rowan = "=0.15.17"
136136
# Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work
137137
# on impls without it
138-
salsa = { version = "0.24.0", default-features = false, features = [
138+
salsa = { version = "0.25.2", default-features = false, features = [
139139
"rayon",
140140
"salsa_unstable",
141141
"macros",
142142
"inventory",
143143
] }
144-
salsa-macros = "0.24.0"
144+
salsa-macros = "0.25.2"
145145
semver = "1.0.26"
146146
serde = { version = "1.0.219" }
147147
serde_derive = { version = "1.0.219" }

crates/hir-ty/src/consteval.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ pub(crate) fn eval_to_const<'db>(expr: ExprId, ctx: &mut InferenceContext<'_, 'd
257257

258258
pub(crate) fn const_eval_cycle_result<'db>(
259259
_: &'db dyn HirDatabase,
260+
_: salsa::Id,
260261
_: ConstId,
261262
_: GenericArgs<'db>,
262263
_: Option<ParamEnvAndCrate<'db>>,
@@ -266,13 +267,15 @@ pub(crate) fn const_eval_cycle_result<'db>(
266267

267268
pub(crate) fn const_eval_static_cycle_result<'db>(
268269
_: &'db dyn HirDatabase,
270+
_: salsa::Id,
269271
_: StaticId,
270272
) -> Result<Const<'db>, ConstEvalError<'db>> {
271273
Err(ConstEvalError::MirLowerError(MirLowerError::Loop))
272274
}
273275

274276
pub(crate) fn const_eval_discriminant_cycle_result<'db>(
275277
_: &'db dyn HirDatabase,
278+
_: salsa::Id,
276279
_: EnumVariantId,
277280
) -> Result<i128, ConstEvalError<'db>> {
278281
Err(ConstEvalError::MirLowerError(MirLowerError::Loop))

crates/hir-ty/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ pub struct InternedConstParamId {
245245
pub loc: ConstParamId,
246246
}
247247

248-
#[salsa_macros::interned(no_lifetime, debug, revisions = usize::MAX)]
248+
#[salsa_macros::interned(no_lifetime, debug, revisions = usize::MAX, unsafe(non_update_types))]
249249
#[derive(PartialOrd, Ord)]
250250
pub struct InternedOpaqueTyId {
251251
pub loc: ImplTraitId<'db>,

crates/hir-ty/src/infer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> InferenceResult<'_>
162162
ctx.resolve_all()
163163
}
164164

165-
fn infer_cycle_result(db: &dyn HirDatabase, _: DefWithBodyId) -> InferenceResult<'_> {
165+
fn infer_cycle_result(db: &dyn HirDatabase, _: salsa::Id, _: DefWithBodyId) -> InferenceResult<'_> {
166166
InferenceResult {
167167
has_errors: true,
168168
..InferenceResult::new(Ty::new_error(DbInterner::new_no_crate(db), ErrorGuaranteed))
@@ -547,7 +547,7 @@ pub struct InferenceResult<'db> {
547547

548548
#[salsa::tracked]
549549
impl<'db> InferenceResult<'db> {
550-
#[salsa::tracked(returns(ref), cycle_result = infer_cycle_result)]
550+
#[salsa::tracked(returns(ref), cycle_result = infer_cycle_result, unsafe(non_update_types))]
551551
pub fn for_body(db: &'db dyn HirDatabase, def: DefWithBodyId) -> InferenceResult<'db> {
552552
infer_query(db, def)
553553
}

crates/hir-ty/src/layout.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ pub fn layout_of_ty_query<'db>(
359359

360360
pub(crate) fn layout_of_ty_cycle_result<'db>(
361361
_: &dyn HirDatabase,
362+
_: salsa::Id,
362363
_: Ty<'db>,
363364
_: ParamEnvAndCrate<'db>,
364365
) -> Result<Arc<Layout>, LayoutError> {

crates/hir-ty/src/layout/adt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub fn layout_of_adt_query<'db>(
9797

9898
pub(crate) fn layout_of_adt_cycle_result<'db>(
9999
_: &'db dyn HirDatabase,
100+
_: salsa::Id,
100101
_def: AdtId,
101102
_args: GenericArgs<'db>,
102103
_trait_env: ParamEnvAndCrate<'db>,

crates/hir-ty/src/lower.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ impl InternedOpaqueTyId {
11371137

11381138
#[salsa::tracked]
11391139
impl<'db> ImplTraits<'db> {
1140-
#[salsa::tracked(returns(ref), unsafe(non_update_return_type))]
1140+
#[salsa::tracked(returns(ref), unsafe(non_update_types))]
11411141
pub(crate) fn return_type_impl_traits(
11421142
db: &'db dyn HirDatabase,
11431143
def: hir_def::FunctionId,
@@ -1166,7 +1166,7 @@ impl<'db> ImplTraits<'db> {
11661166
}
11671167
}
11681168

1169-
#[salsa::tracked(returns(ref), unsafe(non_update_return_type))]
1169+
#[salsa::tracked(returns(ref), unsafe(non_update_types))]
11701170
pub(crate) fn type_alias_impl_traits(
11711171
db: &'db dyn HirDatabase,
11721172
def: hir_def::TypeAliasId,
@@ -1373,6 +1373,7 @@ pub(crate) fn type_for_type_alias_with_diagnostics_query<'db>(
13731373

13741374
pub(crate) fn type_for_type_alias_with_diagnostics_cycle_result<'db>(
13751375
db: &'db dyn HirDatabase,
1376+
_: salsa::Id,
13761377
_adt: TypeAliasId,
13771378
) -> (EarlyBinder<'db, Ty<'db>>, Diagnostics) {
13781379
(EarlyBinder::bind(Ty::new_error(DbInterner::new_no_crate(db), ErrorGuaranteed)), None)
@@ -1406,6 +1407,7 @@ pub(crate) fn impl_self_ty_with_diagnostics_query<'db>(
14061407

14071408
pub(crate) fn impl_self_ty_with_diagnostics_cycle_result(
14081409
db: &dyn HirDatabase,
1410+
_: salsa::Id,
14091411
_impl_id: ImplId,
14101412
) -> (EarlyBinder<'_, Ty<'_>>, Diagnostics) {
14111413
(EarlyBinder::bind(Ty::new_error(DbInterner::new_no_crate(db), ErrorGuaranteed)), None)
@@ -1443,6 +1445,7 @@ pub(crate) fn const_param_ty_with_diagnostics_query<'db>(
14431445

14441446
pub(crate) fn const_param_ty_with_diagnostics_cycle_result<'db>(
14451447
db: &'db dyn HirDatabase,
1448+
_: salsa::Id,
14461449
_: crate::db::HirDatabaseData,
14471450
_def: ConstParamId,
14481451
) -> (Ty<'db>, Diagnostics) {
@@ -1496,7 +1499,7 @@ pub(crate) fn field_types_with_diagnostics_query<'db>(
14961499
/// following bounds are disallowed: `T: Foo<U::Item>, U: Foo<T::Item>`, but
14971500
/// these are fine: `T: Foo<U::Item>, U: Foo<()>`.
14981501
#[tracing::instrument(skip(db), ret)]
1499-
#[salsa::tracked(returns(ref), unsafe(non_update_return_type), cycle_result = generic_predicates_for_param_cycle_result)]
1502+
#[salsa::tracked(returns(ref), unsafe(non_update_types), cycle_result = generic_predicates_for_param_cycle_result)]
15001503
pub(crate) fn generic_predicates_for_param<'db>(
15011504
db: &'db dyn HirDatabase,
15021505
def: GenericDefId,
@@ -1609,6 +1612,7 @@ pub(crate) fn generic_predicates_for_param<'db>(
16091612

16101613
pub(crate) fn generic_predicates_for_param_cycle_result<'db>(
16111614
_db: &'db dyn HirDatabase,
1615+
_: salsa::Id,
16121616
_def: GenericDefId,
16131617
_param_id: TypeOrConstParamId,
16141618
_assoc_name: Option<Name>,
@@ -1624,7 +1628,7 @@ pub(crate) fn type_alias_bounds<'db>(
16241628
type_alias_bounds_with_diagnostics(db, type_alias).0.as_ref().map_bound(|it| &**it)
16251629
}
16261630

1627-
#[salsa::tracked(returns(ref), unsafe(non_update_return_type))]
1631+
#[salsa::tracked(returns(ref), unsafe(non_update_types))]
16281632
pub fn type_alias_bounds_with_diagnostics<'db>(
16291633
db: &'db dyn HirDatabase,
16301634
type_alias: TypeAliasId,
@@ -1682,7 +1686,7 @@ impl<'db> GenericPredicates<'db> {
16821686
/// Resolve the where clause(s) of an item with generics.
16831687
///
16841688
/// Diagnostics are computed only for this item's predicates, not for parents.
1685-
#[salsa::tracked(returns(ref), unsafe(non_update_return_type))]
1689+
#[salsa::tracked(returns(ref), unsafe(non_update_types))]
16861690
pub fn query_with_diagnostics(
16871691
db: &'db dyn HirDatabase,
16881692
def: GenericDefId,
@@ -2090,6 +2094,7 @@ pub(crate) fn generic_defaults_with_diagnostics_query(
20902094

20912095
pub(crate) fn generic_defaults_with_diagnostics_cycle_result(
20922096
_db: &dyn HirDatabase,
2097+
_: salsa::Id,
20932098
_def: GenericDefId,
20942099
) -> (GenericDefaults<'_>, Diagnostics) {
20952100
(GenericDefaults(None), None)

crates/hir-ty/src/mir/lower.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,7 @@ pub fn mir_body_query<'db>(
22612261

22622262
pub(crate) fn mir_body_cycle_result<'db>(
22632263
_db: &'db dyn HirDatabase,
2264+
_: salsa::Id,
22642265
_def: DefWithBodyId,
22652266
) -> Result<'db, Arc<MirBody<'db>>> {
22662267
Err(MirLowerError::Loop)

crates/hir-ty/src/mir/monomorphization.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ pub fn monomorphized_mir_body_query<'db>(
223223

224224
pub(crate) fn monomorphized_mir_body_cycle_result<'db>(
225225
_db: &'db dyn HirDatabase,
226+
_: salsa::Id,
226227
_: DefWithBodyId,
227228
_: GenericArgs<'db>,
228229
_: ParamEnvAndCrate<'db>,

0 commit comments

Comments
 (0)