Skip to content

Commit 1fd8e9b

Browse files
committed
Add test tracing, fix up comments
1 parent cd339fc commit 1fd8e9b

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ eyre = "0.6.8"
3131
notify-debouncer-mini = "0.4.1"
3232
ordered-float = "4.2.1"
3333
rustversion = "1.0"
34-
test-log = "0.2.11"
34+
test-log = { version ="0.2.11", features = ["trace"] }
3535
trybuild = "1.0"
3636

3737

src/active_query.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl ActiveQuery {
109109
}
110110

111111
/// Adds any dependencies from `other` into `self`.
112-
/// Used during cycle recovery, see [`Runtime::create_cycle_error`].
112+
/// Used during cycle recovery, see [`Runtime::unblock_cycle_and_maybe_throw`].
113113
pub(super) fn add_from(&mut self, other: &ActiveQuery) {
114114
self.changed_at = self.changed_at.max(other.changed_at);
115115
self.durability = self.durability.min(other.durability);
@@ -119,7 +119,7 @@ impl ActiveQuery {
119119
}
120120

121121
/// Removes the participants in `cycle` from my dependencies.
122-
/// Used during cycle recovery, see [`Runtime::create_cycle_error`].
122+
/// Used during cycle recovery, see [`Runtime::unblock_cycle_and_maybe_throw`].
123123
pub(super) fn remove_cycle_participants(&mut self, cycle: &Cycle) {
124124
for p in cycle.participant_keys() {
125125
let p: DependencyIndex = p.into();
@@ -128,7 +128,7 @@ impl ActiveQuery {
128128
}
129129

130130
/// Copy the changed-at, durability, and dependencies from `cycle_query`.
131-
/// Used during cycle recovery, see [`Runtime::create_cycle_error`].
131+
/// Used during cycle recovery, see [`Runtime::unblock_cycle_and_maybe_throw`].
132132
pub(crate) fn take_inputs_from(&mut self, cycle_query: &ActiveQuery) {
133133
self.changed_at = cycle_query.changed_at;
134134
self.durability = cycle_query.durability;

src/cycle.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,15 @@ impl std::fmt::Debug for Cycle {
9494
pub enum CycleRecoveryStrategy {
9595
/// Cannot recover from cycles: panic.
9696
///
97-
/// This is the default. It is also what happens if a cycle
98-
/// occurs and the queries involved have different recovery
99-
/// strategies.
97+
/// This is the default.
10098
///
10199
/// In the case of a failure due to a cycle, the panic
102-
/// value will be XXX (FIXME).
100+
/// value will be the `Cycle`.
103101
Panic,
104102

105103
/// Recovers from cycles by storing a sentinel value.
106104
///
107-
/// This value is computed by the `QueryFunction::cycle_fallback`
105+
/// This value is computed by the query's `recovery_fn`
108106
/// function.
109107
Fallback,
110108
}

src/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub trait Configuration: Any {
6969
/// This invokes the function the user wrote.
7070
fn execute<'db>(db: &'db Self::DbView, input: Self::Input<'db>) -> Self::Output<'db>;
7171

72-
/// If the cycle strategy is `Recover`, then invoked when `key` is a participant
72+
/// If the cycle strategy is `Fallback`, then invoked when `key` is a participant
7373
/// in a cycle to find out what value it should have.
7474
///
7575
/// This invokes the recovery function given by the user.

src/local_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl LocalState {
187187
changed_at: Revision,
188188
) {
189189
debug!(
190-
"report_query_read_and_unwind_if_cycle_resulted(input={:?}, durability={:?}, changed_at={:?})",
190+
"report_tracked_read(input={:?}, durability={:?}, changed_at={:?})",
191191
input, durability, changed_at
192192
);
193193
self.with_query_stack(|stack| {

tests/cycles.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ use salsa::Durability;
4848
// | Cross | Fallback | N/A | Tracked | both | parallel/parallel_cycle_mid_recover.rs |
4949
// | Cross | Fallback | N/A | Tracked | both | parallel/parallel_cycle_all_recover.rs |
5050

51-
// TODO: The following test is not yet ported.
52-
// | Intra | Fallback | Old | Tracked | direct | cycle_disappears_durability |
53-
5451
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
5552
struct Error {
5653
cycle: Vec<String>,

0 commit comments

Comments
 (0)