diff --git a/crates/turbo-tasks-macros/src/value_macro.rs b/crates/turbo-tasks-macros/src/value_macro.rs index 115dcfbe257f14..4f1d309d3faff7 100644 --- a/crates/turbo-tasks-macros/src/value_macro.rs +++ b/crates/turbo-tasks-macros/src/value_macro.rs @@ -324,7 +324,7 @@ pub fn value(args: TokenStream, input: TokenStream) -> TokenStream { /// to be converted into normal cells. #cell_prefix fn local_cell(self) -> turbo_tasks::Vc { let content = self; - turbo_tasks::Vc::cell_private(#cell_access_content) + turbo_tasks::Vc::local_cell_private(#cell_access_content) } }; diff --git a/crates/turbo-tasks/src/vc/mod.rs b/crates/turbo-tasks/src/vc/mod.rs index ce21dd014782ba..08152541ed0246 100644 --- a/crates/turbo-tasks/src/vc/mod.rs +++ b/crates/turbo-tasks/src/vc/mod.rs @@ -274,6 +274,23 @@ where pub fn cell_private(inner: >::Target) -> Self { >::cell(inner) } + + // called by the `.local_cell()` method generated by the `#[turbo_tasks::value]` + // macro + #[doc(hidden)] + pub fn local_cell_private(inner: >::Target) -> Self { + // `T::CellMode` isn't applicable here, we always create new local cells. Local + // cells aren't stored across executions, so there can be no concept of + // "updating" the cell across multiple executions. + let (execution_id, local_cell_id) = create_local_cell(SharedReference::new( + Some(T::get_value_type_id()), + triomphe::Arc::new(T::Read::target_to_repr(inner)), + )); + Vc { + node: RawVc::LocalCell(execution_id, local_cell_id), + _t: PhantomData, + } + } } impl Vc @@ -287,17 +304,7 @@ where } pub fn local_cell(inner: Inner) -> Self { - // `T::CellMode` isn't applicable here, we always create new local cells. Local - // cells aren't stored across executions, so there can be no concept of - // "updating" the cell across multiple executions. - let (execution_id, local_cell_id) = create_local_cell(SharedReference::new( - Some(T::get_value_type_id()), - triomphe::Arc::new(T::Read::target_to_repr(inner)), - )); - Vc { - node: RawVc::LocalCell(execution_id, local_cell_id), - _t: PhantomData, - } + Self::local_cell_private(inner) } }