Address soundness hole in cycle prevention

This commit is contained in:
TechnoPorg committed 2026-01-29 06:56:17 +01:00
1 parent 4ad88bcd68
commit f82205baf4
80 files changed
+730 -717

No files matched your search

+4 -3
View File
@@ -84,10 +84,11 @@ async fn main() {
// Add source tasks with no dependencies
let x = dag.add_task(Value(2));
let y = dag.add_task(Value(3));
let y: TaskHandle<_> = dag.add_task(Value(3)).into();
// Add task that depends on both x and y
let sum = dag.add_task(Add).depends_on((&x, &y));
// Add task that depends on both x and y.
// Here, y could be reused as a dependency for other tasks, while x could not.
let sum = dag.add_task(Add).depends_on((x, &y));
// Execute with true parallelism
dag.run(|fut| tokio::spawn(fut).map(Result::unwrap)).await.unwrap();