From 10a5d69536f8022cf18235bfe350e7c7499079ae Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Wed, 15 May 2024 15:15:23 +0100 Subject: [PATCH] add tags to turbo functions to help with analysis --- crates/turbo-tasks-fetch/src/lib.rs | 2 +- crates/turbo-tasks-fs/src/attach.rs | 12 ++++++------ crates/turbo-tasks-fs/src/lib.rs | 14 +++++++------- crates/turbo-tasks-fs/src/read_glob.rs | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/turbo-tasks-fetch/src/lib.rs b/crates/turbo-tasks-fetch/src/lib.rs index 7684fab16dbea..c6e14b30ae062 100644 --- a/crates/turbo-tasks-fetch/src/lib.rs +++ b/crates/turbo-tasks-fetch/src/lib.rs @@ -46,7 +46,7 @@ pub enum ProxyConfig { #[turbo_tasks::value(transparent)] pub struct OptionProxyConfig(Option); -#[turbo_tasks::function] +#[turbo_tasks::function(network)] pub async fn fetch( url: Vc, user_agent: Vc>, diff --git a/crates/turbo-tasks-fs/src/attach.rs b/crates/turbo-tasks-fs/src/attach.rs index 7fc1af31ec9e1..1a26d311ae491 100644 --- a/crates/turbo-tasks-fs/src/attach.rs +++ b/crates/turbo-tasks-fs/src/attach.rs @@ -121,17 +121,17 @@ impl AttachedFileSystem { #[turbo_tasks::value_impl] impl FileSystem for AttachedFileSystem { - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] fn read(self: Vc, path: Vc) -> Vc { self.get_inner_fs_path(path).read() } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] fn read_link(self: Vc, path: Vc) -> Vc { self.get_inner_fs_path(path).read_link() } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn read_dir(self: Vc, path: Vc) -> Result> { let dir_content = self.get_inner_fs_path(path).read_dir().await?; let entries = match &*dir_content { @@ -157,17 +157,17 @@ impl FileSystem for AttachedFileSystem { Ok(DirectoryContent::new(converted_entries)) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] fn track(self: Vc, path: Vc) -> Vc { self.get_inner_fs_path(path).track() } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] fn write(self: Vc, path: Vc, content: Vc) -> Vc { self.get_inner_fs_path(path).write(content) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] fn write_link( self: Vc, path: Vc, diff --git a/crates/turbo-tasks-fs/src/lib.rs b/crates/turbo-tasks-fs/src/lib.rs index e828fbe69ce90..477052bf3d2c2 100644 --- a/crates/turbo-tasks-fs/src/lib.rs +++ b/crates/turbo-tasks-fs/src/lib.rs @@ -320,7 +320,7 @@ impl Debug for DiskFileSystem { #[turbo_tasks::value_impl] impl FileSystem for DiskFileSystem { - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn read(&self, fs_path: Vc) -> Result> { let full_path = self.to_sys_path(fs_path).await?; self.register_invalidator(&full_path)?; @@ -344,7 +344,7 @@ impl FileSystem for DiskFileSystem { Ok(content.cell()) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn read_dir(&self, fs_path: Vc) -> Result> { let full_path = self.to_sys_path(fs_path).await?; self.register_dir_invalidator(&full_path)?; @@ -403,7 +403,7 @@ impl FileSystem for DiskFileSystem { Ok(DirectoryContent::new(entries)) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn read_link(&self, fs_path: Vc) -> Result> { let full_path = self.to_sys_path(fs_path).await?; self.register_invalidator(&full_path)?; @@ -491,14 +491,14 @@ impl FileSystem for DiskFileSystem { .cell()) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn track(&self, fs_path: Vc) -> Result> { let full_path = self.to_sys_path(fs_path).await?; self.register_invalidator(&full_path)?; Ok(Completion::new()) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn write( &self, fs_path: Vc, @@ -612,7 +612,7 @@ impl FileSystem for DiskFileSystem { Ok(Completion::new()) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn write_link( &self, fs_path: Vc, @@ -699,7 +699,7 @@ impl FileSystem for DiskFileSystem { Ok(Completion::new()) } - #[turbo_tasks::function] + #[turbo_tasks::function(fs)] async fn metadata(&self, fs_path: Vc) -> Result> { let full_path = self.to_sys_path(fs_path).await?; self.register_invalidator(&full_path)?; diff --git a/crates/turbo-tasks-fs/src/read_glob.rs b/crates/turbo-tasks-fs/src/read_glob.rs index 35bffa372dc0a..7e868ccb42de9 100644 --- a/crates/turbo-tasks-fs/src/read_glob.rs +++ b/crates/turbo-tasks-fs/src/read_glob.rs @@ -16,7 +16,7 @@ pub struct ReadGlobResult { /// /// DETERMINISM: Result is in random order. Either sort result or do not depend /// on the order. -#[turbo_tasks::function] +#[turbo_tasks::function(fs)] pub async fn read_glob( directory: Vc, glob: Vc, @@ -25,7 +25,7 @@ pub async fn read_glob( read_glob_internal("", directory, glob, include_dot_files).await } -#[turbo_tasks::function] +#[turbo_tasks::function(fs)] async fn read_glob_inner( prefix: String, directory: Vc,