diff --git a/crates/red_knot_python_semantic/src/semantic_index/constraint.rs b/crates/red_knot_python_semantic/src/semantic_index/constraint.rs index 15f8194289854..cee7e472eddf3 100644 --- a/crates/red_knot_python_semantic/src/semantic_index/constraint.rs +++ b/crates/red_knot_python_semantic/src/semantic_index/constraint.rs @@ -18,7 +18,7 @@ pub(crate) enum ConstraintNode<'db> { } /// Pattern kinds for which we support type narrowing and/or static visibility analysis. -#[derive(Debug, Clone, Hash, PartialEq)] +#[derive(Debug, Clone, Hash, PartialEq, salsa::Update)] pub(crate) enum PatternConstraintKind<'db> { Singleton(Singleton, Option>), Value(Expression<'db>, Option>), @@ -32,11 +32,8 @@ pub(crate) struct PatternConstraint<'db> { pub(crate) file_scope: FileScopeId, - #[no_eq] - #[return_ref] pub(crate) subject: Expression<'db>, - #[no_eq] #[return_ref] pub(crate) kind: PatternConstraintKind<'db>, diff --git a/crates/red_knot_python_semantic/src/semantic_index/definition.rs b/crates/red_knot_python_semantic/src/semantic_index/definition.rs index 2258c14bcd51f..accdb6c181f05 100644 --- a/crates/red_knot_python_semantic/src/semantic_index/definition.rs +++ b/crates/red_knot_python_semantic/src/semantic_index/definition.rs @@ -35,9 +35,9 @@ pub struct Definition<'db> { #[no_eq] #[return_ref] + #[tracked] pub(crate) kind: DefinitionKind<'db>, - #[no_eq] count: countme::Count>, } diff --git a/crates/red_knot_python_semantic/src/semantic_index/expression.rs b/crates/red_knot_python_semantic/src/semantic_index/expression.rs index 66529e722a2cc..69a8968256033 100644 --- a/crates/red_knot_python_semantic/src/semantic_index/expression.rs +++ b/crates/red_knot_python_semantic/src/semantic_index/expression.rs @@ -39,8 +39,8 @@ pub(crate) struct Expression<'db> { pub(crate) file_scope: FileScopeId, /// The expression node. - #[no_eq] #[return_ref] + #[tracked] pub(crate) node_ref: AstNodeRef, /// Should this expression be inferred as a normal expression or a type expression? diff --git a/crates/red_knot_python_semantic/src/types/narrow.rs b/crates/red_knot_python_semantic/src/types/narrow.rs index 9fef834db420f..ead106828d4d2 100644 --- a/crates/red_knot_python_semantic/src/types/narrow.rs +++ b/crates/red_knot_python_semantic/src/types/narrow.rs @@ -231,10 +231,10 @@ impl<'db> NarrowingConstraintsBuilder<'db> { match pattern.kind(self.db) { PatternConstraintKind::Singleton(singleton, _guard) => { - self.evaluate_match_pattern_singleton(*subject, *singleton) + self.evaluate_match_pattern_singleton(subject, *singleton) } PatternConstraintKind::Class(cls, _guard) => { - self.evaluate_match_pattern_class(*subject, *cls) + self.evaluate_match_pattern_class(subject, *cls) } // TODO: support more pattern kinds PatternConstraintKind::Value(..) | PatternConstraintKind::Unsupported => None, diff --git a/crates/red_knot_python_semantic/src/visibility_constraints.rs b/crates/red_knot_python_semantic/src/visibility_constraints.rs index 3467866b6c9d4..aa4c5e6971694 100644 --- a/crates/red_knot_python_semantic/src/visibility_constraints.rs +++ b/crates/red_knot_python_semantic/src/visibility_constraints.rs @@ -627,7 +627,7 @@ impl<'db> VisibilityConstraints<'db> { ConstraintNode::Pattern(inner) => match inner.kind(db) { PatternConstraintKind::Value(value, guard) => { let subject_expression = inner.subject(db); - let inference = infer_expression_types(db, *subject_expression); + let inference = infer_expression_types(db, subject_expression); let scope = subject_expression.scope(db); let subject_ty = inference.expression_type( subject_expression diff --git a/crates/ruff_db/src/testing.rs b/crates/ruff_db/src/testing.rs index cbba5b3cff18b..880a6fccc8867 100644 --- a/crates/ruff_db/src/testing.rs +++ b/crates/ruff_db/src/testing.rs @@ -18,7 +18,7 @@ pub fn assert_function_query_was_not_run( db.attach(|_| { if let Some(will_execute_event) = will_execute_event { - panic!("Expected query {query_name}({id}) not to have run but it did: {will_execute_event:?}"); + panic!("Expected query {query_name}({id}) not to have run but it did: {will_execute_event:?}\n\n{events:#?}"); } }); } @@ -46,7 +46,7 @@ pub fn assert_const_function_query_was_not_run( db.attach(|_| { if let Some(will_execute_event) = event { panic!( - "Expected query {query_name}() not to have run but it did: {will_execute_event:?}" + "Expected query {query_name}() not to have run but it did: {will_execute_event:?}\n\n{events:#?}" ); } }); diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 5eb57a40b593c..a2d2658132ccb 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -29,7 +29,7 @@ ruff_python_formatter = { path = "../crates/ruff_python_formatter" } ruff_text_size = { path = "../crates/ruff_text_size" } libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer", default-features = false } -salsa = { git = "https://github.com/ibraheemdev/salsa.git", rev = "22f742a53d9eafca80fe5a0a6b188b56243c741c" } +salsa = { git = "https://github.com/MichaReiser/salsa.git", rev = "c48a9df2ec58d816e0f602ee3fee3ef483b2f1d4" } similar = { version = "2.5.0" } tracing = { version = "0.1.40" }