Unverified Commit 1ab88376 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

fix(turbo-tasks): Implement `is_transient` on `OperationVc` (#75291)

A function returning an `OperationVc` can call a transient function or have a transient argument.

IMO, `TaskInput` should not have default method implementations to avoid potential footguns like this.
parent 75ab6b04
...@@ -175,7 +175,16 @@ where ...@@ -175,7 +175,16 @@ where
} }
} }
impl<T> TaskInput for OperationVc<T> where T: ?Sized + Send + Sync {} // NOTE: This uses the default implementation of `is_resolved` which returns `true` because we don't
// want `OperationVc` arguments to get resolved when passed to a `#[turbo_tasks::function]`.
impl<T> TaskInput for OperationVc<T>
where
T: ?Sized + Send + Sync,
{
fn is_transient(&self) -> bool {
self.node.is_transient()
}
}
impl<T> From<RawVc> for OperationVc<T> impl<T> From<RawVc> for OperationVc<T>
where where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment