diff --git a/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_inherent_impl.stderr b/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_inherent_impl.stderr index bf19f47a4dabe..877e032b19061 100644 --- a/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_inherent_impl.stderr +++ b/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_inherent_impl.stderr @@ -15,7 +15,10 @@ error[E0277]: the trait bound `IntegersVec: ResolvedValue` is not satisfied (E, D, C, B, A, Z, Y, X, W, V, U, T) and $N others note: required by a bound in `assert_returns_resolved_value` - --> tests/function/fail_resolved_inherent_impl.rs:14:29 + --> $WORKSPACE/turbopack/crates/turbo-tasks/src/macro_helpers.rs | -14 | #[turbo_tasks::function(resolved)] - | ^^^^^^^^ required by this bound in `assert_returns_resolved_value` + | pub fn assert_returns_resolved_value() + | ----------------------------- required by a bound in this function +... + | Rv: ResolvedValue + Send, + | ^^^^^^^^^^^^^ required by this bound in `assert_returns_resolved_value` diff --git a/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_static.stderr b/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_static.stderr index 70fd159e75077..63ba615d4e3dd 100644 --- a/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_static.stderr +++ b/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_static.stderr @@ -15,7 +15,10 @@ error[E0277]: the trait bound `IntegersVec: ResolvedValue` is not satisfied (E, D, C, B, A, Z, Y, X, W, V, U, T) and $N others note: required by a bound in `assert_returns_resolved_value` - --> tests/function/fail_resolved_static.rs:9:25 + --> $WORKSPACE/turbopack/crates/turbo-tasks/src/macro_helpers.rs | -9 | #[turbo_tasks::function(resolved)] - | ^^^^^^^^ required by this bound in `assert_returns_resolved_value` + | pub fn assert_returns_resolved_value() + | ----------------------------- required by a bound in this function +... + | Rv: ResolvedValue + Send, + | ^^^^^^^^^^^^^ required by this bound in `assert_returns_resolved_value` diff --git a/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_trait_impl.stderr b/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_trait_impl.stderr index 78804532a0db9..e18d2811d2f90 100644 --- a/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_trait_impl.stderr +++ b/turbopack/crates/turbo-tasks-macros-tests/tests/function/fail_resolved_trait_impl.stderr @@ -15,7 +15,10 @@ error[E0277]: the trait bound `IntegersVec: ResolvedValue` is not satisfied (E, D, C, B, A, Z, Y, X, W, V, U, T) and $N others note: required by a bound in `assert_returns_resolved_value` - --> tests/function/fail_resolved_trait_impl.rs:19:29 + --> $WORKSPACE/turbopack/crates/turbo-tasks/src/macro_helpers.rs | -19 | #[turbo_tasks::function(resolved)] - | ^^^^^^^^ required by this bound in `assert_returns_resolved_value` + | pub fn assert_returns_resolved_value() + | ----------------------------- required by a bound in this function +... + | Rv: ResolvedValue + Send, + | ^^^^^^^^^^^^^ required by this bound in `assert_returns_resolved_value` diff --git a/turbopack/crates/turbo-tasks-macros/src/func.rs b/turbopack/crates/turbo-tasks-macros/src/func.rs index 2855b3977438b..ae0c6129d1f92 100644 --- a/turbopack/crates/turbo-tasks-macros/src/func.rs +++ b/turbopack/crates/turbo-tasks-macros/src/func.rs @@ -338,14 +338,7 @@ impl TurboFn { quote_spanned! { span => { - fn assert_returns_resolved_value< - ReturnType, - Rv, - >() where - ReturnType: turbo_tasks::task::TaskOutput>, - Rv: turbo_tasks::ResolvedValue + Send, - {} - assert_returns_resolved_value::<#return_type, _>() + turbo_tasks::macro_helpers::assert_returns_resolved_value::<#return_type, _>() } } } else { diff --git a/turbopack/crates/turbo-tasks/src/macro_helpers.rs b/turbopack/crates/turbo-tasks/src/macro_helpers.rs index e4e3e47016dfc..1e9313826069e 100644 --- a/turbopack/crates/turbo-tasks/src/macro_helpers.rs +++ b/turbopack/crates/turbo-tasks/src/macro_helpers.rs @@ -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 { @@ -29,6 +31,13 @@ pub fn get_non_local_persistence_from_inputs(inputs: &impl TaskInput) -> TaskPer } } +pub fn assert_returns_resolved_value() +where + ReturnType: TaskOutput>, + Rv: ResolvedValue + Send, +{ +} + #[macro_export] macro_rules! stringify_path { ($path:path) => {