From ad61687e838c871cc559aaee8569e849bce51eeb Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 19 Jul 2024 08:09:55 -0400 Subject: [PATCH] wip --- components/salsa-macros/src/accumulator.rs | 1 - src/function/accumulated.rs | 2 +- ...of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs | 6 +++--- ...field_x_of_an_input_changes_but_fn_depends_on_field_y.rs | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/salsa-macros/src/accumulator.rs b/components/salsa-macros/src/accumulator.rs index 644425ec..83d2421d 100644 --- a/components/salsa-macros/src/accumulator.rs +++ b/components/salsa-macros/src/accumulator.rs @@ -1,5 +1,4 @@ use proc_macro2::TokenStream; -use syn::parse::Nothing; use crate::{ hygiene::Hygiene, diff --git a/src/function/accumulated.rs b/src/function/accumulated.rs index 8bd86140..c5ab7321 100644 --- a/src/function/accumulated.rs +++ b/src/function/accumulated.rs @@ -1,4 +1,4 @@ -use crate::{accumulator, storage::DatabaseGen, Database, Id}; +use crate::{accumulator, storage::DatabaseGen, Id}; use super::{Configuration, IngredientImpl}; diff --git a/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs b/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs index 7eaa9f06..c462a97d 100644 --- a/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs +++ b/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs @@ -74,13 +74,13 @@ fn execute() { assert_eq!(final_result_depends_on_x(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result_depends_on_x(MyInput { [salsa id]: 0 })", + "final_result_depends_on_x(MyInput { [salsa id]: 0, field: 22 })", ]"#]]); assert_eq!(final_result_depends_on_y(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result_depends_on_y(MyInput { [salsa id]: 0 })", + "final_result_depends_on_y(MyInput { [salsa id]: 0, field: 22 })", ]"#]]); input.set_field(&mut db).to(23); @@ -90,7 +90,7 @@ fn execute() { assert_eq!(final_result_depends_on_x(&db, input), 24); db.assert_logs(expect![[r#" [ - "final_result_depends_on_x(MyInput { [salsa id]: 0 })", + "final_result_depends_on_x(MyInput { [salsa id]: 0, field: 23 })", ]"#]]); // y = 23 / 2 = 11 diff --git a/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs b/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs index 5ddb1422..2d39ee14 100644 --- a/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs +++ b/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs @@ -59,13 +59,13 @@ fn execute() { assert_eq!(result_depends_on_x(&db, input), 23); db.assert_logs(expect![[r#" [ - "result_depends_on_x(MyInput { [salsa id]: 0 })", + "result_depends_on_x(MyInput { [salsa id]: 0, x: 22, y: 33 })", ]"#]]); assert_eq!(result_depends_on_y(&db, input), 32); db.assert_logs(expect![[r#" [ - "result_depends_on_y(MyInput { [salsa id]: 0 })", + "result_depends_on_y(MyInput { [salsa id]: 0, x: 22, y: 33 })", ]"#]]); input.set_x(&mut db).to(23); @@ -73,7 +73,7 @@ fn execute() { assert_eq!(result_depends_on_x(&db, input), 24); db.assert_logs(expect![[r#" [ - "result_depends_on_x(MyInput { [salsa id]: 0 })", + "result_depends_on_x(MyInput { [salsa id]: 0, x: 23, y: 33 })", ]"#]]); // input y is the same, so result depends on y