mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-23 05:07:27 +00:00
add the fields of tracked struct to the output of queries
This commit is contained in:
parent
4c4096e39b
commit
99cfca5799
2 changed files with 4 additions and 0 deletions
|
@ -100,6 +100,8 @@ where
|
||||||
C::Key: TrackedStructInDb<DynDb<'db, C>>,
|
C::Key: TrackedStructInDb<DynDb<'db, C>>,
|
||||||
{
|
{
|
||||||
self.specify(db, key, value, |_| QueryOrigin::Field);
|
self.specify(db, key, value, |_| QueryOrigin::Field);
|
||||||
|
let database_key_index = self.database_key_index(key);
|
||||||
|
db.runtime().add_output(database_key_index.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specify the value for `key` *and* record that we did so.
|
/// Specify the value for `key` *and* record that we did so.
|
||||||
|
@ -138,6 +140,7 @@ where
|
||||||
// assigneed by `executor`.
|
// assigneed by `executor`.
|
||||||
match memo.revisions.origin {
|
match memo.revisions.origin {
|
||||||
QueryOrigin::Assigned(by_query) => assert_eq!(by_query, executor),
|
QueryOrigin::Assigned(by_query) => assert_eq!(by_query, executor),
|
||||||
|
QueryOrigin::Field => {}
|
||||||
_ => panic!(
|
_ => panic!(
|
||||||
"expected a query assigned by `{:?}`, not `{:?}`",
|
"expected a query assigned by `{:?}`, not `{:?}`",
|
||||||
executor.debug(db),
|
executor.debug(db),
|
||||||
|
|
|
@ -104,6 +104,7 @@ fn basic() {
|
||||||
db.assert_logs(expect![[r#"
|
db.assert_logs(expect![[r#"
|
||||||
[
|
[
|
||||||
"intermediate_result(MyInput(Id { value: 1 }))",
|
"intermediate_result(MyInput(Id { value: 1 }))",
|
||||||
|
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: field(2) })",
|
||||||
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: MyTracked(2) })",
|
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: MyTracked(2) })",
|
||||||
"salsa_event(DidDiscard { key: MyTracked(2) })",
|
"salsa_event(DidDiscard { key: MyTracked(2) })",
|
||||||
"salsa_event(DidDiscard { key: field(2) })",
|
"salsa_event(DidDiscard { key: field(2) })",
|
||||||
|
|
Loading…
Reference in a new issue