Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(turbo-tasks-macros): Move assert_returns_resolved_value into helper module #68867

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions turbopack/crates/turbo-tasks-macros/src/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,7 @@ impl TurboFn {
quote_spanned! {
span =>
{
fn assert_returns_resolved_value<
ReturnType,
Rv,
>() where
ReturnType: turbo_tasks::task::TaskOutput<Return = Vc<Rv>>,
Rv: turbo_tasks::ResolvedValue + Send,
{}
assert_returns_resolved_value::<#return_type, _>()
turbo_tasks::macro_helpers::assert_returns_resolved_value::<#return_type, _>()
}
}
} else {
Expand Down
11 changes: 10 additions & 1 deletion turbopack/crates/turbo-tasks/src/macro_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ pub use super::{
magic_any::MagicAny,
manager::{find_cell_by_type, notify_scheduled_tasks, spawn_detached_for_testing},
};
use crate::{debug::ValueDebugFormatString, TaskInput, TaskPersistence};
use crate::{
debug::ValueDebugFormatString, task::TaskOutput, ResolvedValue, TaskInput, TaskPersistence, Vc,
};

#[inline(never)]
pub async fn value_debug_format_field(value: ValueDebugFormatString<'_>) -> String {
Expand All @@ -29,6 +31,13 @@ pub fn get_non_local_persistence_from_inputs(inputs: &impl TaskInput) -> TaskPer
}
}

pub fn assert_returns_resolved_value<ReturnType, Rv>()
where
ReturnType: TaskOutput<Return = Vc<Rv>>,
Rv: ResolvedValue + Send,
{
}

#[macro_export]
macro_rules! stringify_path {
($path:path) => {
Expand Down
Loading