Skip to content

Commit

Permalink
add direct cycle detection (#5544)
Browse files Browse the repository at this point in the history
### Description

very simple detection of dumb mistakes
  • Loading branch information
sokra authored Jul 17, 2023
1 parent 02f55d9 commit 135c08f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/turbo-tasks-memory/src/memory_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,17 @@ impl Backend for MemoryBackend {

fn task_execution_result(
&self,
task: TaskId,
task_id: TaskId,
result: Result<Result<RawVc>, Option<Cow<'static, str>>>,
turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>,
) {
self.with_task(task, |task| {
self.with_task(task_id, |task| {
#[cfg(debug_assertions)]
if let Ok(Ok(RawVc::TaskOutput(result))) = result.as_ref() {
if *result == task_id {
panic!("Task {} returned itself as output", task.get_description());
}
}
task.execution_result(result, self, turbo_tasks);
})
}
Expand Down

0 comments on commit 135c08f

Please sign in to comment.