diff --git a/tests/debug.rs b/tests/debug.rs index a614d9b13..0ea84f13b 100644 --- a/tests/debug.rs +++ b/tests/debug.rs @@ -53,7 +53,7 @@ fn input() { // debug includes all fields let actual = format!("{:?}", complex_struct.debug(&db)); let expected = expect![[ - r#"ComplexStruct { [salsa id]: 0, my_input: MyInput { [salsa id]: 0, field: 22 }, not_salsa: NotSalsa { field: "it's salsa time" } }"# + r#"ComplexStruct { [salsa id]: Id(0), my_input: MyInput { [salsa id]: Id(0), field: 22 }, not_salsa: NotSalsa { field: "it's salsa time" } }"# ]]; expected.assert_eq(&actual); } @@ -74,7 +74,7 @@ fn untracked_dependencies() { let s = leak_debug_string(&db, input); expect![[r#" - "MyInput { [salsa id]: 0, field: 22 }" + "MyInput { [salsa id]: Id(0), field: 22 }" "#]] .assert_debug_eq(&s); @@ -118,7 +118,7 @@ fn custom_debug_impl() { let s = leak_derived_custom(&db, input, 23); expect![[r#" - "MyInput { [salsa id]: 0, field: 22 } / 23" + "MyInput { [salsa id]: Id(0), field: 22 } / 23" "#]] .assert_debug_eq(&s); } diff --git a/tests/deletion-cascade.rs b/tests/deletion-cascade.rs index eb6c83920..2e1150111 100644 --- a/tests/deletion-cascade.rs +++ b/tests/deletion-cascade.rs @@ -96,8 +96,8 @@ fn basic() { assert_eq!(final_result(&db, input), 2 * 2 + 2); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Creates only 2 tracked structs in this revision, should delete 1 @@ -118,12 +118,12 @@ fn basic() { assert_eq!(final_result(&db, input), 2); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", "salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: MyTracked(2) })", "salsa_event(DidDiscard { key: MyTracked(2) })", "salsa_event(DidDiscard { key: contribution_from_struct(2) })", "salsa_event(DidDiscard { key: MyTracked(5) })", "salsa_event(DidDiscard { key: copy_field(5) })", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", ]"#]]); } diff --git a/tests/deletion.rs b/tests/deletion.rs index fb5298729..7b450129a 100644 --- a/tests/deletion.rs +++ b/tests/deletion.rs @@ -89,8 +89,8 @@ fn basic() { assert_eq!(final_result(&db, input), 2 * 2 + 2); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Creates only 2 tracked structs in this revision, should delete 1 @@ -104,10 +104,10 @@ fn basic() { assert_eq!(final_result(&db, input), 2); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", "salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: MyTracked(2) })", "salsa_event(DidDiscard { key: MyTracked(2) })", "salsa_event(DidDiscard { key: contribution_from_struct(2) })", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", ]"#]]); } diff --git a/tests/elided-lifetime-in-tracked-fn.rs b/tests/elided-lifetime-in-tracked-fn.rs index 5ce24f478..6dc9f7201 100644 --- a/tests/elided-lifetime-in-tracked-fn.rs +++ b/tests/elided-lifetime-in-tracked-fn.rs @@ -59,8 +59,8 @@ fn execute() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Intermediate result is the same, so final result does @@ -69,14 +69,14 @@ fn execute() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); input.set_field(&mut db).to(24); assert_eq!(final_result(&db, input), 24); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", - "final_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", + "final_result(MyInput { [salsa id]: Id(0) })", ]"#]]); } 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 dab6c0fcc..97aa5cf59 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 @@ -79,13 +79,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]: Id(0) })", ]"#]]); 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]: Id(0) })", ]"#]]); input.set_field(&mut db).to(23); @@ -95,7 +95,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]: Id(0) })", ]"#]]); // 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 76643443c..144cd55f2 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 @@ -58,13 +58,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]: Id(0) })", ]"#]]); 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]: Id(0) })", ]"#]]); input.set_x(&mut db).to(23); @@ -72,7 +72,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]: Id(0) })", ]"#]]); // input y is the same, so result depends on y diff --git a/tests/hello_world.rs b/tests/hello_world.rs index e14d4b6bb..50c880ee3 100644 --- a/tests/hello_world.rs +++ b/tests/hello_world.rs @@ -59,8 +59,8 @@ fn execute() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Intermediate result is the same, so final result does @@ -69,15 +69,15 @@ fn execute() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); input.set_field(&mut db).to(24); assert_eq!(final_result(&db, input), 24); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", - "final_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", + "final_result(MyInput { [salsa id]: Id(0) })", ]"#]]); } @@ -90,8 +90,8 @@ fn red_herring() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Create a distinct input and mutate it. diff --git a/tests/input_with_ids.rs b/tests/input_with_ids.rs index 3656c8e3b..6e6e6ac6d 100644 --- a/tests/input_with_ids.rs +++ b/tests/input_with_ids.rs @@ -38,7 +38,7 @@ fn test_debug() { let input = MyInput::new(&mut db, 50, 10, Field {}); let actual = format!("{:?}", input.debug(&db)); - let expected = expect!["MyInput { [salsa id]: 0, id_one: 50, id_two: 10, field: Field }"]; + let expected = expect!["MyInput { [salsa id]: Id(0), id_one: 50, id_two: 10, field: Field }"]; expected.assert_eq(&actual); } diff --git a/tests/interned-struct-with-lifetime.rs b/tests/interned-struct-with-lifetime.rs index 2e7bee80c..765d29101 100644 --- a/tests/interned-struct-with-lifetime.rs +++ b/tests/interned-struct-with-lifetime.rs @@ -52,7 +52,7 @@ fn execute() { let mut db = Database::default(); expect![[r#" - "InternedPair { [salsa id]: 0, data: (InternedString { [salsa id]: 0, data: \"Hello, \" }, InternedString { [salsa id]: 1, data: \"World, \" }) }" + "InternedPair { [salsa id]: Id(0), data: (InternedString { [salsa id]: Id(0), data: \"Hello, \" }, InternedString { [salsa id]: Id(1), data: \"World, \" }) }" "#]].assert_debug_eq(&intern_stuff(&db)); db.assert_logs(expect!["[]"]); } diff --git a/tests/singleton.rs b/tests/singleton.rs index adf339ed9..80963e953 100644 --- a/tests/singleton.rs +++ b/tests/singleton.rs @@ -68,6 +68,6 @@ fn debug() { let db = Database::default(); let input = MyInput::new(&db, 3, 4); let actual = format!("{:?}", input.debug(&db)); - let expected = expect!["MyInput { [salsa id]: 0, field: 3, id_field: 4 }"]; + let expected = expect!["MyInput { [salsa id]: Id(0), field: 3, id_field: 4 }"]; expected.assert_eq(&actual); } diff --git a/tests/specify_tracked_fn_in_rev_1_but_not_2.rs b/tests/specify_tracked_fn_in_rev_1_but_not_2.rs index a96e65057..562780c66 100644 --- a/tests/specify_tracked_fn_in_rev_1_but_not_2.rs +++ b/tests/specify_tracked_fn_in_rev_1_but_not_2.rs @@ -96,13 +96,13 @@ fn test_run_0() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); } @@ -117,13 +117,13 @@ fn test_run_5() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); } @@ -138,16 +138,16 @@ fn test_run_10() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: maybe_specified(0) } }", - "maybe_specified(MyTracked { [salsa id]: 0 })", + "maybe_specified(MyTracked { [salsa id]: Id(0) })", ]"#]]); } @@ -161,16 +161,16 @@ fn test_run_20() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: maybe_specified(0) } }", - "maybe_specified(MyTracked { [salsa id]: 0 })", + "maybe_specified(MyTracked { [salsa id]: Id(0) })", ]"#]]); } @@ -188,13 +188,13 @@ fn test_run_0_then_5_then_20() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); @@ -209,7 +209,7 @@ fn test_run_0_then_5_then_20() { "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: DidValidateMemoizedValue { database_key: read_maybe_specified(0) } }", @@ -228,17 +228,17 @@ fn test_run_0_then_5_then_20() { "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillDiscardStaleOutput { execute_key: create_tracked(0), output_key: maybe_specified(0) } }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: maybe_specified(0) } }", - "maybe_specified(MyTracked { [salsa id]: 0 })", + "maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); @@ -258,13 +258,13 @@ fn test_run_0_then_5_then_10_then_20() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); @@ -279,7 +279,7 @@ fn test_run_0_then_5_then_10_then_20() { "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: DidValidateMemoizedValue { database_key: read_maybe_specified(0) } }", @@ -298,12 +298,12 @@ fn test_run_0_then_5_then_10_then_20() { "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillDiscardStaleOutput { execute_key: create_tracked(0), output_key: maybe_specified(0) } }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: maybe_specified(0) } }", - "maybe_specified(MyTracked { [salsa id]: 0 })", + "maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: DidValidateMemoizedValue { database_key: read_maybe_specified(0) } }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: DidValidateMemoizedValue { database_key: final_result(0) } }", ]"#]]); @@ -318,16 +318,16 @@ fn test_run_0_then_5_then_10_then_20() { "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: maybe_specified(0) } }", - "maybe_specified(MyTracked { [salsa id]: 0 })", + "maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); @@ -343,13 +343,13 @@ fn test_run_5_then_20() { [ "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); @@ -360,17 +360,17 @@ fn test_run_5_then_20() { "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: create_tracked(0) } }", - "create_tracked(MyInput { [salsa id]: 0 })", + "create_tracked(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillDiscardStaleOutput { execute_key: create_tracked(0), output_key: maybe_specified(0) } }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: maybe_specified(0) } }", - "maybe_specified(MyTracked { [salsa id]: 0 })", + "maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: read_maybe_specified(0) } }", - "read_maybe_specified(MyTracked { [salsa id]: 0 })", + "read_maybe_specified(MyTracked { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillExecute { database_key: final_result(0) } }", - "final_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", "Event { runtime_id: RuntimeId { counter: 0 }, kind: WillCheckCancellation }", ]"#]]); diff --git a/tests/tracked_fn_read_own_entity.rs b/tests/tracked_fn_read_own_entity.rs index 0aa354dcc..b00750c2f 100644 --- a/tests/tracked_fn_read_own_entity.rs +++ b/tests/tracked_fn_read_own_entity.rs @@ -60,8 +60,8 @@ fn one_entity() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Intermediate result is the same, so final result does @@ -70,15 +70,15 @@ fn one_entity() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); input.set_field(&mut db).to(24); assert_eq!(final_result(&db, input), 24); db.assert_logs(expect![[r#" [ - "intermediate_result(MyInput { [salsa id]: 0 })", - "final_result(MyInput { [salsa id]: 0 })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", + "final_result(MyInput { [salsa id]: Id(0) })", ]"#]]); } @@ -91,8 +91,8 @@ fn red_herring() { assert_eq!(final_result(&db, input), 22); db.assert_logs(expect![[r#" [ - "final_result(MyInput { [salsa id]: 0 })", - "intermediate_result(MyInput { [salsa id]: 0 })", + "final_result(MyInput { [salsa id]: Id(0) })", + "intermediate_result(MyInput { [salsa id]: Id(0) })", ]"#]]); // Create a distinct input and mutate it. diff --git a/tests/tracked_fn_read_own_specify.rs b/tests/tracked_fn_read_own_specify.rs index 5785464af..5049a1401 100644 --- a/tests/tracked_fn_read_own_specify.rs +++ b/tests/tracked_fn_read_own_specify.rs @@ -56,7 +56,7 @@ fn execute() { assert_eq!(tracked_fn(&db, input), 2222); db.assert_logs(expect![[r#" [ - "tracked_fn(MyInput { [salsa id]: 0, field: 22 })", + "tracked_fn(MyInput { [salsa id]: Id(0), field: 22 })", ]"#]]); // A "synthetic write" causes the system to act *as though* some diff --git a/tests/tracked_with_struct_db.rs b/tests/tracked_with_struct_db.rs index 737aef256..6a3889653 100644 --- a/tests/tracked_with_struct_db.rs +++ b/tests/tracked_with_struct_db.rs @@ -51,16 +51,24 @@ fn execute() { let t1 = create_tracked_list(&db, input); expect_test::expect![[r#" MyTracked { - [salsa id]: 1, + [salsa id]: Id( + 1, + ), data: MyInput { - [salsa id]: 0, + [salsa id]: Id( + 0, + ), field: "foo", }, next: Next( MyTracked { - [salsa id]: 0, + [salsa id]: Id( + 0, + ), data: MyInput { - [salsa id]: 0, + [salsa id]: Id( + 0, + ), field: "foo", }, next: None,