Skip to content

Commit 76127e5

Browse files
authored
[ty] Update salsa (#21281)
1 parent cddc0fe commit 76127e5

4 files changed

Lines changed: 17 additions & 21 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ regex-automata = { version = "0.4.9" }
146146
rustc-hash = { version = "2.0.0" }
147147
rustc-stable-hash = { version = "0.1.2" }
148148
# When updating salsa, make sure to also update the revision in `fuzz/Cargo.toml`
149-
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "664750a6e588ed23a0d2d9105a02cb5993c8e178", default-features = false, features = [
149+
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "05a9af7f554b64b8aadc2eeb6f2caf73d0408d09", default-features = false, features = [
150150
"compact_str",
151151
"macros",
152152
"salsa_unstable",

crates/ty_python_semantic/src/types/infer.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,15 @@ pub(crate) fn infer_definition_types<'db>(
114114
fn definition_cycle_recover<'db>(
115115
db: &'db dyn Db,
116116
_id: salsa::Id,
117-
_last_provisional_value: &DefinitionInference<'db>,
118-
_value: &DefinitionInference<'db>,
117+
last_provisional_value: &DefinitionInference<'db>,
118+
value: DefinitionInference<'db>,
119119
count: u32,
120120
definition: Definition<'db>,
121-
) -> salsa::CycleRecoveryAction<DefinitionInference<'db>> {
122-
if count == ITERATIONS_BEFORE_FALLBACK {
123-
salsa::CycleRecoveryAction::Fallback(DefinitionInference::cycle_fallback(
124-
definition.scope(db),
125-
))
121+
) -> DefinitionInference<'db> {
122+
if &value == last_provisional_value || count != ITERATIONS_BEFORE_FALLBACK {
123+
value
126124
} else {
127-
salsa::CycleRecoveryAction::Iterate
125+
DefinitionInference::cycle_fallback(definition.scope(db))
128126
}
129127
}
130128

@@ -230,17 +228,15 @@ pub(crate) fn infer_isolated_expression<'db>(
230228
fn expression_cycle_recover<'db>(
231229
db: &'db dyn Db,
232230
_id: salsa::Id,
233-
_last_provisional_value: &ExpressionInference<'db>,
234-
_value: &ExpressionInference<'db>,
231+
last_provisional_value: &ExpressionInference<'db>,
232+
value: ExpressionInference<'db>,
235233
count: u32,
236234
input: InferExpression<'db>,
237-
) -> salsa::CycleRecoveryAction<ExpressionInference<'db>> {
238-
if count == ITERATIONS_BEFORE_FALLBACK {
239-
salsa::CycleRecoveryAction::Fallback(ExpressionInference::cycle_fallback(
240-
input.expression(db).scope(db),
241-
))
235+
) -> ExpressionInference<'db> {
236+
if &value == last_provisional_value || count != ITERATIONS_BEFORE_FALLBACK {
237+
value
242238
} else {
243-
salsa::CycleRecoveryAction::Iterate
239+
ExpressionInference::cycle_fallback(input.expression(db).scope(db))
244240
}
245241
}
246242

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ty_python_semantic = { path = "../crates/ty_python_semantic" }
3030
ty_vendored = { path = "../crates/ty_vendored" }
3131

3232
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer", default-features = false }
33-
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "664750a6e588ed23a0d2d9105a02cb5993c8e178", default-features = false, features = [
33+
salsa = { git = "https://github.com/salsa-rs/salsa.git", rev = "05a9af7f554b64b8aadc2eeb6f2caf73d0408d09", default-features = false, features = [
3434
"compact_str",
3535
"macros",
3636
"salsa_unstable",

0 commit comments

Comments
 (0)