-
Notifications
You must be signed in to change notification settings - Fork 27.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide some turbo_tasks internals (vercel/turborepo#5584)
### Description This hides _some_ turbo_tasks internals from its public API. It's currently not possible to completely hide them (hence `Vc::into_raw`/unsafe `Vc::<AutoSet<RawVc>>::from_task_id`) because turbo-tasks-memory still depends on some internal types, but this is a step in the right direction.
- Loading branch information
Showing
19 changed files
with
109 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::marker::PhantomData; | ||
|
||
use auto_hash_map::AutoSet; | ||
// This specific macro identifier is detected by turbo-tasks-build. | ||
use turbo_tasks_macros::primitive as __turbo_tasks_internal_primitive; | ||
|
||
use crate as turbo_tasks; | ||
use crate::{RawVc, TaskId, Vc}; | ||
|
||
__turbo_tasks_internal_primitive!(AutoSet<RawVc>); | ||
|
||
impl Vc<AutoSet<RawVc>> { | ||
/// Casts a `TaskId` to a `Vc<AutoSet<RawVc>>`. | ||
/// | ||
/// # Safety | ||
/// | ||
/// The `TaskId` must be point to a valid `AutoSet<RawVc>`. | ||
pub unsafe fn from_task_id(task_id: TaskId) -> Self { | ||
Vc { | ||
node: RawVc::TaskOutput(task_id), | ||
_t: PhantomData, | ||
} | ||
} | ||
} |
Oops, something went wrong.