diff --git a/crates/turbo-tasks-memory/src/aggregation_tree/bottom_connection.rs b/crates/turbo-tasks-memory/src/aggregation_tree/bottom_connection.rs index fef611f483cf5..5eba13d5c9daa 100644 --- a/crates/turbo-tasks-memory/src/aggregation_tree/bottom_connection.rs +++ b/crates/turbo-tasks-memory/src/aggregation_tree/bottom_connection.rs @@ -2,12 +2,11 @@ use std::{hash::Hash, ops::ControlFlow, sync::Arc}; use auto_hash_map::{map::RawEntry, AutoMap}; use nohash_hasher::{BuildNoHashHasher, IsEnabled}; -use smallvec::SmallVec; use super::{ bottom_tree::BottomTree, inner_refs::{BottomRef, ChildLocation}, - AggregationContext, + AggregationContext, StackVec, }; struct BottomRefInfo { @@ -197,7 +196,7 @@ impl BottomConnection { pub enum BottomUppers { Left(Arc>), - Inner(SmallVec<[(BottomRef, u8); 16]>), + Inner(StackVec<(BottomRef, u8)>), } impl BottomUppers { diff --git a/crates/turbo-tasks-memory/src/aggregation_tree/bottom_tree.rs b/crates/turbo-tasks-memory/src/aggregation_tree/bottom_tree.rs index 1d82bb7854693..409afc5bf5f89 100644 --- a/crates/turbo-tasks-memory/src/aggregation_tree/bottom_tree.rs +++ b/crates/turbo-tasks-memory/src/aggregation_tree/bottom_tree.rs @@ -3,7 +3,6 @@ use std::{hash::Hash, ops::ControlFlow, sync::Arc}; use nohash_hasher::{BuildNoHashHasher, IsEnabled}; use parking_lot::{Mutex, MutexGuard}; use ref_cast::RefCast; -use smallvec::SmallVec; use super::{ bottom_connection::BottomConnection, @@ -13,7 +12,7 @@ use super::{ remove_left_upper_from_item, }, top_tree::TopTree, - AggregationContext, CHILDREN_INNER_THRESHOLD, CONNECTIVITY_LIMIT, + AggregationContext, StackVec, CHILDREN_INNER_THRESHOLD, CONNECTIVITY_LIMIT, }; use crate::count_hash_set::{CountHashSet, RemoveIfEntryResult}; @@ -82,7 +81,7 @@ impl BottomTree { } } - fn add_children_of_child_if_following(&self, children: &mut SmallVec<[&I; 16]>) { + fn add_children_of_child_if_following(&self, children: &mut StackVec<&I>) { let mut state = self.state.lock(); children.retain(|&mut child| !state.following.add_if_entry(child)); } @@ -90,7 +89,7 @@ impl BottomTree { fn add_children_of_child_following>( self: &Arc, aggregation_context: &C, - mut children: SmallVec<[&I; 16]>, + mut children: StackVec<&I>, ) { let mut state = self.state.lock(); children.retain(|&mut child| state.following.add_clonable(child)); @@ -114,7 +113,7 @@ impl BottomTree { ) where I: 'a, { - let mut following = SmallVec::default(); + let mut following = StackVec::default(); if self.height == 0 { for child in children { let can_be_inner = @@ -254,7 +253,7 @@ impl BottomTree { children: &mut Vec<&'a I>, ) { let mut state = self.state.lock(); - let mut removed = SmallVec::<[_; 16]>::default(); + let mut removed = StackVec::default(); children.retain(|&child| match state.following.remove_if_entry(child) { RemoveIfEntryResult::PartiallyRemoved => false, RemoveIfEntryResult::NotPresent => true, @@ -285,7 +284,7 @@ impl BottomTree { fn remove_children_of_child_following>( self: &Arc, aggregation_context: &C, - mut children: SmallVec<[&I; 16]>, + mut children: StackVec<&I>, ) { let mut state = self.state.lock(); children.retain(|&mut child| state.following.remove_clonable(child)); @@ -315,7 +314,7 @@ impl BottomTree { ) where I: 'a, { - let unremoveable: SmallVec<[_; 16]> = if self.height == 0 { + let unremoveable: StackVec<_> = if self.height == 0 { children .into_iter() .filter(|&child| !remove_inner_upper_from_item(aggregation_context, child, self)) @@ -342,11 +341,7 @@ impl BottomTree { let mut state = self.state.lock(); let old_inner = state.bottom_upper.set_left_upper(upper); let add_change = aggregation_context.info_to_add_change(&state.data); - let children = state - .following - .iter() - .cloned() - .collect::>(); + let children = state.following.iter().cloned().collect::>(); let remove_change = (!old_inner.is_unset()) .then(|| aggregation_context.info_to_remove_change(&state.data)) @@ -443,11 +438,7 @@ impl BottomTree { if let Some(change) = aggregation_context.info_to_add_change(&state.data) { upper.child_change(aggregation_context, &change); } - let children = state - .following - .iter() - .cloned() - .collect::>(); + let children = state.following.iter().cloned().collect::>(); drop(state); if !children.is_empty() { upper.add_children_of_child( @@ -471,11 +462,7 @@ impl BottomTree { if let Some(change) = aggregation_context.info_to_remove_change(&state.data) { upper.child_change(aggregation_context, &change); } - let following = state - .following - .iter() - .cloned() - .collect::>(); + let following = state.following.iter().cloned().collect::>(); if state.top_upper.is_empty() { drop(state); self.remove_self_from_lower(aggregation_context); @@ -498,11 +485,7 @@ impl BottomTree { let removed = inner.remove_clonable(BottomRef::ref_cast(upper)); if removed { let remove_change = aggregation_context.info_to_remove_change(&state.data); - let following = state - .following - .iter() - .cloned() - .collect::>(); + let following = state.following.iter().cloned().collect::>(); drop(state); if let Some(change) = remove_change { upper.child_change(aggregation_context, &change); @@ -600,11 +583,7 @@ fn propagate_lost_following_to_uppers( child_of_child: &C::ItemRef, ) { let bottom_uppers = state.bottom_upper.as_cloned_uppers(); - let top_upper = state - .top_upper - .iter() - .cloned() - .collect::>(); + let top_upper = state.top_upper.iter().cloned().collect::>(); drop(state); for TopRef { upper } in top_upper { upper.remove_child_of_child(aggregation_context, child_of_child); diff --git a/crates/turbo-tasks-memory/src/aggregation_tree/leaf.rs b/crates/turbo-tasks-memory/src/aggregation_tree/leaf.rs index 7df978aa2a90a..91cc5a51131bf 100644 --- a/crates/turbo-tasks-memory/src/aggregation_tree/leaf.rs +++ b/crates/turbo-tasks-memory/src/aggregation_tree/leaf.rs @@ -3,7 +3,6 @@ use std::{hash::Hash, sync::Arc}; use auto_hash_map::AutoSet; use nohash_hasher::IsEnabled; use ref_cast::RefCast; -use smallvec::SmallVec; use tracing::Level; use super::{ @@ -11,7 +10,7 @@ use super::{ bottom_tree::BottomTree, inner_refs::{BottomRef, ChildLocation}, top_tree::TopTree, - AggregationContext, AggregationItemLock, CHILDREN_INNER_THRESHOLD, + AggregationContext, AggregationItemLock, LargeStackVec, CHILDREN_INNER_THRESHOLD, }; /// The leaf of the aggregation tree. It's usually stored inside of the nodes @@ -245,7 +244,7 @@ pub fn add_inner_upper_to_item( change, item.children() .map(|r| r.into_owned()) - .collect::>(), + .collect::>(), ) } else { return true; @@ -267,7 +266,7 @@ pub fn add_inner_upper_to_item( struct AddLeftUpperIntermediateResult( Option, - SmallVec<[C::ItemRef; 128]>, + LargeStackVec, DistanceCountMap>, Option, ); @@ -352,7 +351,7 @@ pub fn remove_inner_upper_from_item( let children = item .children() .map(|r| r.into_owned()) - .collect::>(); + .collect::>(); drop(item); if let Some(change) = change { diff --git a/crates/turbo-tasks-memory/src/aggregation_tree/mod.rs b/crates/turbo-tasks-memory/src/aggregation_tree/mod.rs index 83472da064bf6..cb5e449176772 100644 --- a/crates/turbo-tasks-memory/src/aggregation_tree/mod.rs +++ b/crates/turbo-tasks-memory/src/aggregation_tree/mod.rs @@ -35,6 +35,7 @@ mod top_tree; use std::{borrow::Cow, hash::Hash, ops::ControlFlow, sync::Arc}; use nohash_hasher::IsEnabled; +use smallvec::SmallVec; use self::{leaf::top_tree, top_tree::TopTree}; pub use self::{ @@ -49,6 +50,9 @@ const CONNECTIVITY_LIMIT: u8 = 7; /// When reached the parent of the children will form a new bottom tree. const CHILDREN_INNER_THRESHOLD: usize = 2000; +type StackVec = SmallVec<[I; 16]>; +type LargeStackVec = SmallVec<[I; 32]>; + /// The context trait which defines how the aggregation tree should behave. pub trait AggregationContext { type ItemLock<'a>: AggregationItemLock< diff --git a/crates/turbo-tasks-memory/src/cell.rs b/crates/turbo-tasks-memory/src/cell.rs index 23a23927351df..b76556b44792d 100644 --- a/crates/turbo-tasks-memory/src/cell.rs +++ b/crates/turbo-tasks-memory/src/cell.rs @@ -4,11 +4,10 @@ use std::{ }; use auto_hash_map::AutoSet; -use nohash_hasher::BuildNoHashHasher; use turbo_tasks::{ backend::CellContent, event::{Event, EventListener}, - TaskId, TurboTasksBackendApi, + TaskId, TaskIdSet, TurboTasksBackendApi, }; use crate::MemoryBackend; @@ -25,20 +24,18 @@ pub(crate) enum Cell { /// tracking is still active. Any update will invalidate dependent tasks. /// Assigning a value will transition to the Value state. /// Reading this cell will transition to the Recomputing state. - TrackedValueless { - dependent_tasks: AutoSet, 2>, - }, + TrackedValueless { dependent_tasks: TaskIdSet }, /// Someone wanted to read the content and it was not available. The content /// is now being recomputed. /// Assigning a value will transition to the Value state. Recomputing { - dependent_tasks: AutoSet, 2>, + dependent_tasks: TaskIdSet, event: Event, }, /// The content was set only once and is tracked. /// GC operation will transition to the TrackedValueless state. Value { - dependent_tasks: AutoSet, 2>, + dependent_tasks: TaskIdSet, content: CellContent, }, } @@ -95,11 +92,10 @@ impl Cell { } /// Returns the list of dependent tasks. - pub fn dependent_tasks(&self) -> &AutoSet, 2> { + pub fn dependent_tasks(&self) -> &TaskIdSet { match self { Cell::Empty => { - static EMPTY: AutoSet, 2> = - AutoSet::with_hasher(); + static EMPTY: TaskIdSet = AutoSet::with_hasher(); &EMPTY } Cell::Value { @@ -117,7 +113,7 @@ impl Cell { /// Switch the cell to recomputing state. fn recompute( &mut self, - dependent_tasks: AutoSet, 2>, + dependent_tasks: TaskIdSet, description: impl Fn() -> String + Sync + Send + 'static, note: impl Fn() -> String + Sync + Send + 'static, ) -> EventListener { diff --git a/crates/turbo-tasks-memory/src/memory_backend.rs b/crates/turbo-tasks-memory/src/memory_backend.rs index 4721514f4ec11..09175fd6aa385 100644 --- a/crates/turbo-tasks-memory/src/memory_backend.rs +++ b/crates/turbo-tasks-memory/src/memory_backend.rs @@ -15,7 +15,6 @@ use std::{ use anyhow::{bail, Result}; use auto_hash_map::{AutoMap, AutoSet}; use dashmap::{mapref::entry::Entry, DashMap}; -use nohash_hasher::BuildNoHashHasher; use rustc_hash::FxHasher; use tokio::task::futures::TaskLocalFuture; use tracing::trace_span; @@ -26,7 +25,7 @@ use turbo_tasks::{ }, event::EventListener, util::{IdFactory, NoMoveVec}, - CellId, RawVc, TaskId, TraitTypeId, TurboTasksBackendApi, Unused, + CellId, RawVc, TaskId, TaskIdSet, TraitTypeId, TurboTasksBackendApi, Unused, }; use crate::{ @@ -221,7 +220,7 @@ impl MemoryBackend { pub(crate) fn schedule_when_dirty_from_aggregation( &self, - set: AutoSet, 2>, + set: TaskIdSet, turbo_tasks: &dyn TurboTasksBackendApi, ) { for task in set { @@ -262,7 +261,7 @@ impl Backend for MemoryBackend { fn invalidate_tasks_set( &self, - tasks: &AutoSet, 2>, + tasks: &TaskIdSet, turbo_tasks: &dyn TurboTasksBackendApi, ) { for &task in tasks { diff --git a/crates/turbo-tasks-memory/src/memory_backend_with_pg.rs b/crates/turbo-tasks-memory/src/memory_backend_with_pg.rs index f40d7886590eb..725041f3bbcf9 100644 --- a/crates/turbo-tasks-memory/src/memory_backend_with_pg.rs +++ b/crates/turbo-tasks-memory/src/memory_backend_with_pg.rs @@ -16,7 +16,6 @@ use anyhow::{anyhow, Result}; use auto_hash_map::{AutoMap, AutoSet}; use concurrent_queue::ConcurrentQueue; use dashmap::{mapref::entry::Entry, DashMap, DashSet}; -use nohash_hasher::BuildNoHashHasher; use turbo_tasks::{ backend::{ Backend, BackendJobId, CellContent, PersistentTaskType, TaskExecutionSpec, @@ -28,7 +27,7 @@ use turbo_tasks::{ PersistedGraphApi, ReadTaskState, TaskCell, TaskData, }, util::{IdFactory, NoMoveVec, SharedError}, - CellId, RawVc, TaskId, TraitTypeId, TurboTasksBackendApi, Unused, + CellId, RawVc, TaskId, TaskIdSet, TraitTypeId, TurboTasksBackendApi, Unused, }; type RootTaskFn = @@ -65,11 +64,11 @@ struct MemoryTaskState { need_persist: bool, has_changes: bool, freshness: TaskFreshness, - cells: HashMap, 2>)>, + cells: HashMap, output: Option>, - output_dependent: AutoSet, 2>, + output_dependent: TaskIdSet, dependencies: AutoSet, - children: AutoSet, 2>, + children: TaskIdSet, event: Event, event_cells: Event, } @@ -1040,7 +1039,7 @@ impl Backend for MemoryBackendWithPersistedGraph

{ fn invalidate_tasks_set( &self, - tasks: &AutoSet, 2>, + tasks: &TaskIdSet, turbo_tasks: &dyn TurboTasksBackendApi>, ) { for &task in tasks { diff --git a/crates/turbo-tasks-memory/src/output.rs b/crates/turbo-tasks-memory/src/output.rs index c6c66a23b67aa..443b5d5e2d267 100644 --- a/crates/turbo-tasks-memory/src/output.rs +++ b/crates/turbo-tasks-memory/src/output.rs @@ -5,9 +5,7 @@ use std::{ }; use anyhow::{anyhow, Error, Result}; -use auto_hash_map::AutoSet; -use nohash_hasher::BuildNoHashHasher; -use turbo_tasks::{util::SharedError, RawVc, TaskId, TurboTasksBackendApi}; +use turbo_tasks::{util::SharedError, RawVc, TaskId, TaskIdSet, TurboTasksBackendApi}; use crate::MemoryBackend; @@ -15,7 +13,7 @@ use crate::MemoryBackend; pub struct Output { pub(crate) content: OutputContent, updates: u32, - pub(crate) dependent_tasks: AutoSet, 2>, + pub(crate) dependent_tasks: TaskIdSet, } #[derive(Clone, Debug, Default)] @@ -97,7 +95,7 @@ impl Output { } } - pub fn dependent_tasks(&self) -> &AutoSet, 2> { + pub fn dependent_tasks(&self) -> &TaskIdSet { &self.dependent_tasks } diff --git a/crates/turbo-tasks-memory/src/task.rs b/crates/turbo-tasks-memory/src/task.rs index fe96895a2feca..4113343a8c213 100644 --- a/crates/turbo-tasks-memory/src/task.rs +++ b/crates/turbo-tasks-memory/src/task.rs @@ -28,8 +28,8 @@ use tokio::task_local; use turbo_tasks::{ backend::{PersistentTaskType, TaskExecutionSpec}, event::{Event, EventListener}, - get_invalidator, registry, CellId, Invalidator, RawVc, StatsType, TaskId, TraitTypeId, - TurboTasksBackendApi, ValueTypeId, + get_invalidator, registry, CellId, Invalidator, RawVc, StatsType, TaskId, TaskIdSet, + TraitTypeId, TurboTasksBackendApi, ValueTypeId, }; use crate::{ @@ -170,7 +170,7 @@ struct TaskState { stateful: bool, /// Children are only modified from execution - children: AutoSet, 2>, + children: TaskIdSet, /// Collectibles are only modified from execution collectibles: MaybeCollectibles, @@ -389,7 +389,7 @@ enum TaskStateType { event: Event, count_as_finished: bool, /// Children that need to be disconnected once leaving this state - outdated_children: AutoSet, 2>, + outdated_children: TaskIdSet, outdated_collectibles: MaybeCollectibles, }, diff --git a/crates/turbo-tasks-memory/src/task/aggregation.rs b/crates/turbo-tasks-memory/src/task/aggregation.rs index 6ba1f8b0747a1..2ab9214ac4785 100644 --- a/crates/turbo-tasks-memory/src/task/aggregation.rs +++ b/crates/turbo-tasks-memory/src/task/aggregation.rs @@ -4,10 +4,10 @@ use std::{ mem::take, }; -use auto_hash_map::{map::Entry, AutoMap, AutoSet}; +use auto_hash_map::{map::Entry, AutoMap}; use nohash_hasher::BuildNoHashHasher; use parking_lot::Mutex; -use turbo_tasks::{event::Event, RawVc, TaskId, TraitTypeId, TurboTasksBackendApi}; +use turbo_tasks::{event::Event, RawVc, TaskId, TaskIdSet, TraitTypeId, TurboTasksBackendApi}; use super::{meta_state::TaskMetaStateWriteGuard, TaskStateType}; use crate::{ @@ -26,7 +26,7 @@ pub enum RootType { #[derive(Debug, Default)] pub struct CollectiblesInfo { collectibles: AutoMap, - dependent_tasks: AutoSet, 2>, + dependent_tasks: TaskIdSet, } impl CollectiblesInfo { @@ -140,8 +140,8 @@ impl TaskChange { pub struct TaskAggregationContext<'a> { pub turbo_tasks: &'a dyn TurboTasksBackendApi, pub backend: &'a MemoryBackend, - pub dirty_tasks_to_schedule: Mutex, 2>>>, - pub tasks_to_notify: Mutex, 2>>>, + pub dirty_tasks_to_schedule: Mutex>, + pub tasks_to_notify: Mutex>, } impl<'a> TaskAggregationContext<'a> { diff --git a/crates/turbo-tasks-testing/src/lib.rs b/crates/turbo-tasks-testing/src/lib.rs index ee73f462afd80..a3dc1fc4023c8 100644 --- a/crates/turbo-tasks-testing/src/lib.rs +++ b/crates/turbo-tasks-testing/src/lib.rs @@ -48,37 +48,34 @@ impl TurboTasksCallApi for VcStorage { let future = func(); let i = { let mut tasks = self.tasks.lock().unwrap(); - let i = tasks.len() + 1; + let i = tasks.len(); tasks.push(Task::Spawned(Event::new(move || { format!("Task({i})::event") }))); i }; - handle.spawn(with_turbo_tasks_for_testing( - this.clone(), - TaskId::from(i), - async move { - let result = AssertUnwindSafe(future).catch_unwind().await; - - // Convert the unwind panic to an anyhow error that can be cloned. - let result = result - .map_err(|any| match any.downcast::() { - Ok(owned) => anyhow!(owned), - Err(any) => match any.downcast::<&'static str>() { - Ok(str) => anyhow!(str), - Err(_) => anyhow!("unknown panic"), - }, - }) - .and_then(|r| r) - .map_err(SharedError::new); - - let mut tasks = this.tasks.lock().unwrap(); - if let Task::Spawned(event) = replace(&mut tasks[i - 1], Task::Finished(result)) { - event.notify(usize::MAX); - } - }, - )); - RawVc::TaskOutput(i.into()) + let id = TaskId::from(i + 1); + handle.spawn(with_turbo_tasks_for_testing(this.clone(), id, async move { + let result = AssertUnwindSafe(future).catch_unwind().await; + + // Convert the unwind panic to an anyhow error that can be cloned. + let result = result + .map_err(|any| match any.downcast::() { + Ok(owned) => anyhow!(owned), + Err(any) => match any.downcast::<&'static str>() { + Ok(str) => anyhow!(str), + Err(_) => anyhow!("unknown panic"), + }, + }) + .and_then(|r| r) + .map_err(SharedError::new); + + let mut tasks = this.tasks.lock().unwrap(); + if let Task::Spawned(event) = replace(&mut tasks[i], Task::Finished(result)) { + event.notify(usize::MAX); + } + })); + RawVc::TaskOutput(id) } fn native_call( @@ -144,11 +141,12 @@ impl TurboTasksApi for VcStorage { fn try_read_task_output( &self, - task: TaskId, + id: TaskId, _strongly_consistent: bool, ) -> Result> { let tasks = self.tasks.lock().unwrap(); - let task = tasks.get(*task - 1).unwrap(); + let i = *id - 1; + let task = tasks.get(i).unwrap(); match task { Task::Spawned(event) => Ok(Err(event.listen())), Task::Finished(result) => match result { diff --git a/crates/turbo-tasks/src/backend.rs b/crates/turbo-tasks/src/backend.rs index 704f9f8e8e719..07134e6b9be22 100644 --- a/crates/turbo-tasks/src/backend.rs +++ b/crates/turbo-tasks/src/backend.rs @@ -10,8 +10,7 @@ use std::{ }; use anyhow::{anyhow, bail, Result}; -use auto_hash_map::{AutoMap, AutoSet}; -use nohash_hasher::BuildNoHashHasher; +use auto_hash_map::AutoMap; use serde::{Deserialize, Serialize}; use tracing::Instrument; @@ -19,7 +18,7 @@ pub use crate::id::BackendJobId; use crate::{ event::EventListener, manager::TurboTasksBackendApi, raw_vc::CellId, registry, ConcreteTaskInput, FunctionId, RawVc, ReadRef, SharedReference, TaskId, TaskIdProvider, - TraitRef, TraitTypeId, VcValueTrait, VcValueType, + TaskIdSet, TraitRef, TraitTypeId, VcValueTrait, VcValueType, }; pub enum TaskType { @@ -195,11 +194,7 @@ pub trait Backend: Sync + Send { fn invalidate_task(&self, task: TaskId, turbo_tasks: &dyn TurboTasksBackendApi); fn invalidate_tasks(&self, tasks: &[TaskId], turbo_tasks: &dyn TurboTasksBackendApi); - fn invalidate_tasks_set( - &self, - tasks: &AutoSet, 2>, - turbo_tasks: &dyn TurboTasksBackendApi, - ); + fn invalidate_tasks_set(&self, tasks: &TaskIdSet, turbo_tasks: &dyn TurboTasksBackendApi); fn get_task_description(&self, task: TaskId) -> String; diff --git a/crates/turbo-tasks/src/lib.rs b/crates/turbo-tasks/src/lib.rs index a6e79cef6d6aa..bf2c4187d3ffe 100644 --- a/crates/turbo-tasks/src/lib.rs +++ b/crates/turbo-tasks/src/lib.rs @@ -73,6 +73,7 @@ mod value_type; mod vc; pub use anyhow::{Error, Result}; +use auto_hash_map::AutoSet; pub use collectibles::CollectiblesSource; pub use completion::{Completion, Completions}; pub use display::ValueToString; @@ -91,6 +92,7 @@ pub use manager::{ Unused, UpdateInfo, }; pub use native_function::NativeFunction; +use nohash_hasher::BuildNoHashHasher; pub use raw_vc::{CellId, RawVc, ReadRawVcFuture, ResolveTypeError}; pub use read_ref::ReadRef; pub use state::State; @@ -107,6 +109,8 @@ pub use vc::{ VcDefaultRead, VcRead, VcTransparentRead, VcValueTrait, VcValueType, }; +pub type TaskIdSet = AutoSet, 2>; + pub mod test_helpers { pub use super::manager::{current_task_for_testing, with_turbo_tasks_for_testing}; } diff --git a/crates/turbo-tasks/src/manager.rs b/crates/turbo-tasks/src/manager.rs index 0207c15744deb..ff59cf309fb23 100644 --- a/crates/turbo-tasks/src/manager.rs +++ b/crates/turbo-tasks/src/manager.rs @@ -15,7 +15,7 @@ use std::{ }; use anyhow::{anyhow, Result}; -use auto_hash_map::{AutoMap, AutoSet}; +use auto_hash_map::AutoMap; use futures::FutureExt; use nohash_hasher::BuildNoHashHasher; use serde::{de::Visitor, Deserialize, Serialize}; @@ -35,7 +35,7 @@ use crate::{ trace::TraceRawVcs, util::{FormatDuration, StaticOrArc}, Completion, ConcreteTaskInput, InvalidationReason, InvalidationReasonSet, SharedReference, - TaskId, ValueTypeId, Vc, VcRead, VcValueTrait, VcValueType, + TaskId, TaskIdSet, ValueTypeId, Vc, VcRead, VcValueTrait, VcValueType, }; pub trait TurboTasksCallApi: Sync + Send { @@ -206,7 +206,7 @@ pub trait TurboTasksBackendApi: /// Enqueues tasks for notification of changed dependencies. This will /// eventually call `invalidate_tasks()` on all tasks. - fn schedule_notify_tasks_set(&self, tasks: &AutoSet, 2>); + fn schedule_notify_tasks_set(&self, tasks: &TaskIdSet); /// Returns the stats reporting type. fn stats_type(&self) -> StatsType; @@ -1111,7 +1111,7 @@ impl TurboTasksBackendApi for TurboTasks { /// Enqueues tasks for notification of changed dependencies. This will /// eventually call `dependent_cell_updated()` on all tasks. - fn schedule_notify_tasks_set(&self, tasks: &AutoSet, 2>) { + fn schedule_notify_tasks_set(&self, tasks: &TaskIdSet) { let result = CURRENT_TASK_STATE.try_with(|cell| { let CurrentTaskState { tasks_to_notify, ..