Unverified Commit acd89db7 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

codemod(turbopack): Rewrite Vc fields in structs as ResolvedVc (part 5) (#71861)

Generated using a version of https://github.com/vercel/turbopack-resolved-vc-codemod . This uses Anthropic Claude Sonnet 3.5 for more complicated errors we don't have hardcoded logic for.

- Part 1: #70927
- Part 2: #71172
- Part 3: #71665
- Part 4: #71804

Closes PACK-3339
parent 0105f6bf
......@@ -576,8 +576,10 @@ async fn create_module_asset(
..Default::default()
}
.into(),
)));
let compile_time_info = CompileTimeInfo::builder(env).cell();
)))
.to_resolved()
.await?;
let compile_time_info = CompileTimeInfo::builder(*env).cell();
let glob_mappings = vec![
(
root,
......
......@@ -17,7 +17,7 @@ pub struct AssetIdent {
/// The fragment of the asset (e.g. `#foo`)
pub fragment: Option<ResolvedVc<RcStr>>,
/// The assets that are nested in this asset
pub assets: Vec<(Vc<RcStr>, Vc<AssetIdent>)>,
pub assets: Vec<(ResolvedVc<RcStr>, ResolvedVc<AssetIdent>)>,
/// The modifiers of this asset (e.g. `client chunks`)
pub modifiers: Vec<Vc<RcStr>>,
/// The part of the asset that is a (ECMAScript) module
......@@ -31,7 +31,7 @@ impl AssetIdent {
self.modifiers.push(modifier);
}
pub fn add_asset(&mut self, key: Vc<RcStr>, asset: Vc<AssetIdent>) {
pub fn add_asset(&mut self, key: ResolvedVc<RcStr>, asset: ResolvedVc<AssetIdent>) {
self.assets.push((key, asset));
}
......
......@@ -252,7 +252,7 @@ impl OutputAsset for CssChunk {
let CssChunkContent { chunk_items, .. } = &*self.content.await?;
let mut common_path = if let Some(chunk_item) = chunk_items.first() {
let path = chunk_item.asset_ident().path().resolve().await?;
let path = chunk_item.asset_ident().path().to_resolved().await?;
Some((path, path.await?))
} else {
None
......@@ -265,7 +265,7 @@ impl OutputAsset for CssChunk {
if let Some((common_path_vc, common_path_ref)) = common_path.as_mut() {
let path = chunk_item.asset_ident().path().await?;
while !path.is_inside_or_equal_ref(common_path_ref) {
let parent = common_path_vc.parent().resolve().await?;
let parent = common_path_vc.parent().to_resolved().await?;
if parent == *common_path_vc {
common_path = None;
break;
......@@ -274,19 +274,17 @@ impl OutputAsset for CssChunk {
*common_path_ref = (*common_path_vc).await?;
}
}
assets.push((chunk_item_key, chunk_item.content_ident()));
}
// Make sure the idents are resolved
for (_, ident) in assets.iter_mut() {
*ident = ident.resolve().await?;
assets.push((
chunk_item_key.to_resolved().await?,
chunk_item.content_ident().to_resolved().await?,
));
}
let ident = AssetIdent {
path: if let Some((common_path, _)) = common_path {
common_path
*common_path
} else {
ServerFileSystem::new().root()
*ServerFileSystem::new().root().to_resolved().await?
},
query: Vc::<RcStr>::default(),
fragment: None,
......
......@@ -24,7 +24,7 @@ use super::{
#[turbo_tasks::value(serialization = "none")]
pub enum ResolveSourceRequestResult {
NotFound,
Static(Vc<StaticContent>, ResolvedVc<HeaderList>),
Static(ResolvedVc<StaticContent>, ResolvedVc<HeaderList>),
HttpProxy(Vc<ProxyResult>),
}
......@@ -107,7 +107,7 @@ pub async fn resolve_source_request(
}
ContentSourceContent::Static(static_content) => {
return Ok(ResolveSourceRequestResult::Static(
**static_content,
*static_content,
HeaderList::new(response_header_overwrites)
.to_resolved()
.await?,
......
......@@ -3,7 +3,8 @@ use std::{fmt::Write, mem::replace};
use anyhow::Result;
use serde::{Deserialize, Serialize};
use turbo_tasks::{
fxindexmap, trace::TraceRawVcs, FxIndexMap, RcStr, TaskInput, TryJoinIterExt, ValueToString, Vc,
fxindexmap, trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, TaskInput, TryJoinIterExt,
ValueToString, Vc,
};
use super::{GetContentSourceContent, GetContentSourceContents};
......@@ -101,7 +102,7 @@ pub struct RouteTree {
base: Vec<BaseSegment>,
sources: Vec<Vc<Box<dyn GetContentSourceContent>>>,
static_segments: FxIndexMap<RcStr, Vc<RouteTree>>,
dynamic_segments: Vec<Vc<RouteTree>>,
dynamic_segments: Vec<ResolvedVc<RouteTree>>,
catch_all_sources: Vec<Vc<Box<dyn GetContentSourceContent>>>,
fallback_sources: Vec<Vc<Box<dyn GetContentSourceContent>>>,
not_found_sources: Vec<Vc<Box<dyn GetContentSourceContent>>>,
......@@ -339,7 +340,7 @@ impl RouteTree {
.cell()),
BaseSegment::Dynamic => Ok(RouteTree {
base,
dynamic_segments: vec![inner.cell()],
dynamic_segments: vec![inner.resolved_cell()],
..Default::default()
}
.cell()),
......@@ -366,24 +367,26 @@ impl RouteTree {
fallback_sources,
not_found_sources,
} = &mut this;
sources
.iter_mut()
.for_each(|s| *s = mapper.map_get_content(*s));
catch_all_sources
.iter_mut()
.for_each(|s| *s = mapper.map_get_content(*s));
fallback_sources
.iter_mut()
.for_each(|s| *s = mapper.map_get_content(*s));
not_found_sources
.iter_mut()
.for_each(|s| *s = mapper.map_get_content(*s));
static_segments
.values_mut()
.for_each(|r| *r = r.map_routes(mapper));
dynamic_segments
.iter_mut()
.for_each(|r| *r = r.map_routes(mapper));
for s in sources.iter_mut() {
*s = mapper.map_get_content(*s);
}
for s in catch_all_sources.iter_mut() {
*s = mapper.map_get_content(*s);
}
for s in fallback_sources.iter_mut() {
*s = mapper.map_get_content(*s);
}
for s in not_found_sources.iter_mut() {
*s = mapper.map_get_content(*s);
}
for r in static_segments.values_mut() {
*r = r.map_routes(mapper);
}
for r in dynamic_segments.iter_mut() {
*r = r.map_routes(mapper).to_resolved().await?;
}
Ok(this.cell())
}
}
......
......@@ -78,7 +78,7 @@ impl Chunk for EcmascriptChunk {
let EcmascriptChunkContent { chunk_items, .. } = &*self.content.await?;
let mut common_path = if let Some((chunk_item, _)) = chunk_items.first() {
let path = chunk_item.asset_ident().path().resolve().await?;
let path = chunk_item.asset_ident().path().to_resolved().await?;
Some((path, path.await?))
} else {
None
......@@ -90,7 +90,7 @@ impl Chunk for EcmascriptChunk {
if let Some((common_path_vc, common_path_ref)) = common_path.as_mut() {
let path = chunk_item.asset_ident().path().await?;
while !path.is_inside_or_equal_ref(common_path_ref) {
let parent = common_path_vc.parent().resolve().await?;
let parent = common_path_vc.parent().to_resolved().await?;
if parent == *common_path_vc {
common_path = None;
break;
......@@ -99,21 +99,21 @@ impl Chunk for EcmascriptChunk {
*common_path_ref = (*common_path_vc).await?;
}
}
assets.push((chunk_item_key, chunk_item.content_ident()));
assets.push((
chunk_item_key.to_resolved().await?,
chunk_item.content_ident().to_resolved().await?,
));
}
// Make sure the idents are resolved
for (_, ident) in assets.iter_mut() {
*ident = ident.resolve().await?;
}
// The previous resolve loop is no longer needed since we're already using ResolvedVc
let ident = AssetIdent {
path: if let Some((common_path, _)) = common_path {
common_path
*common_path
} else {
ServerFileSystem::new().root()
*ServerFileSystem::new().root().to_resolved().await?
},
query: Vc::<RcStr>::default(),
query: *Vc::<RcStr>::default().to_resolved().await?,
fragment: None,
assets,
modifiers: Vec::new(),
......
use anyhow::Result;
use turbo_tasks::{FxIndexSet, RcStr, TryJoinIterExt, Value, ValueToString, Vc};
use turbo_tasks::{FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, Value, ValueToString, Vc};
use turbo_tasks_fs::{File, FileSystemPath};
use turbopack_core::{
asset::{Asset, AssetContent},
......@@ -39,7 +39,7 @@ pub struct ChunkGroupFilesAsset {
pub module: Vc<Box<dyn ChunkableModule>>,
pub client_root: Vc<FileSystemPath>,
pub chunking_context: Vc<Box<dyn ChunkingContext>>,
pub runtime_entries: Option<Vc<EvaluatableAssets>>,
pub runtime_entries: Option<ResolvedVc<EvaluatableAssets>>,
}
#[turbo_tasks::function]
......@@ -132,6 +132,8 @@ impl ChunkGroupFilesChunkItem {
inner.module.ident(),
inner
.runtime_entries
.as_deref()
.copied()
.unwrap_or_else(EvaluatableAssets::empty)
.with_entry(ecma),
Value::new(AvailabilityInfo::Root),
......
......@@ -3,7 +3,7 @@ use swc_core::ecma::{
ast::Stmt,
visit::{AstParentKind, VisitMut},
};
use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, RcStr, Vc};
use turbo_tasks::{debug::ValueDebugFormat, trace::TraceRawVcs, RcStr, ResolvedVc, Vc};
use turbopack_core::chunk::{AsyncModuleInfo, ChunkingContext};
/// impl of code generation inferred from a ModuleReference.
......@@ -108,7 +108,7 @@ pub trait CodeGenerateableWithAsyncModuleInfo {
#[derive(Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TraceRawVcs, ValueDebugFormat)]
pub enum CodeGen {
CodeGenerateable(Vc<Box<dyn CodeGenerateable>>),
CodeGenerateableWithAsyncModuleInfo(Vc<Box<dyn CodeGenerateableWithAsyncModuleInfo>>),
CodeGenerateableWithAsyncModuleInfo(ResolvedVc<Box<dyn CodeGenerateableWithAsyncModuleInfo>>),
}
#[turbo_tasks::value(transparent)]
......
......@@ -523,7 +523,10 @@ impl Module for EcmascriptModuleAsset {
if let Some(inner_assets) = self.inner_assets {
let mut ident = self.source.ident().await?.clone_value();
for (name, asset) in inner_assets.await?.iter() {
ident.add_asset(Vc::cell(name.to_string().into()), asset.ident());
ident.add_asset(
ResolvedVc::cell(name.to_string().into()),
asset.ident().to_resolved().await?,
);
}
ident.add_modifier(modifier());
ident.layer = Some(self.asset_context.layer().to_resolved().await?);
......
......@@ -14,7 +14,9 @@ use swc_core::{
},
quote, quote_expr,
};
use turbo_tasks::{trace::TraceRawVcs, FxIndexMap, RcStr, TryFlatJoinIterExt, ValueToString, Vc};
use turbo_tasks::{
trace::TraceRawVcs, FxIndexMap, RcStr, ResolvedVc, TryFlatJoinIterExt, ValueToString, Vc,
};
use turbo_tasks_fs::glob::Glob;
use turbopack_core::{
chunk::ChunkingContext,
......@@ -425,7 +427,7 @@ pub struct EsmExports {
pub struct ExpandedExports {
pub exports: BTreeMap<RcStr, EsmExport>,
/// Modules we couldn't analyse all exports of.
pub dynamic_exports: Vec<Vc<Box<dyn EcmascriptChunkPlaceable>>>,
pub dynamic_exports: Vec<ResolvedVc<Box<dyn EcmascriptChunkPlaceable>>>,
}
#[turbo_tasks::value_impl]
......@@ -456,7 +458,7 @@ impl EsmExports {
}
if export_info.has_dynamic_exports {
dynamic_exports.push(**asset);
dynamic_exports.push(*asset);
}
}
......
......@@ -240,14 +240,14 @@ impl AnalyzeEcmascriptModuleResultBuilder {
/// Adds a codegen to the analysis result.
#[allow(dead_code)]
pub fn add_code_gen_with_availability_info<C>(&mut self, code_gen: Vc<C>)
pub fn add_code_gen_with_availability_info<C>(&mut self, code_gen: ResolvedVc<C>)
where
C: Upcast<Box<dyn CodeGenerateableWithAsyncModuleInfo>>,
{
self.code_gens
.push(CodeGen::CodeGenerateableWithAsyncModuleInfo(Vc::upcast(
code_gen,
)));
.push(CodeGen::CodeGenerateableWithAsyncModuleInfo(
ResolvedVc::upcast(code_gen),
));
}
pub fn add_binding(&mut self, binding: EsmBinding) {
......@@ -319,7 +319,7 @@ impl AnalyzeEcmascriptModuleResultBuilder {
*c = c.resolve().await?;
}
CodeGen::CodeGenerateableWithAsyncModuleInfo(c) => {
*c = c.resolve().await?;
*c = c.to_resolved().await?;
}
}
}
......
......@@ -12,7 +12,7 @@ use swc_core::{
},
quote, quote_expr,
};
use turbo_tasks::{primitives::Regex, FxIndexMap, RcStr, Value, ValueToString, Vc};
use turbo_tasks::{primitives::Regex, FxIndexMap, RcStr, ResolvedVc, Value, ValueToString, Vc};
use turbo_tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemPath};
use turbopack_core::{
asset::{Asset, AssetContent},
......@@ -46,8 +46,8 @@ use crate::{
#[turbo_tasks::value]
#[derive(Debug)]
pub(crate) enum DirListEntry {
File(Vc<FileSystemPath>),
Dir(Vc<DirList>),
File(ResolvedVc<FileSystemPath>),
Dir(ResolvedVc<DirList>),
}
#[turbo_tasks::value(transparent)]
......@@ -83,7 +83,7 @@ impl DirList {
DirectoryEntry::File(path) => {
if let Some(relative_path) = root_val.get_relative_path_to(&*path.await?) {
if regex.is_match(&relative_path) {
list.insert(relative_path, DirListEntry::File(**path));
list.insert(relative_path, DirListEntry::File(*path));
}
}
}
......@@ -91,9 +91,11 @@ impl DirList {
if let Some(relative_path) = root_val.get_relative_path_to(&*path.await?) {
list.insert(
relative_path,
DirListEntry::Dir(DirList::read_internal(
root, **path, recursive, filter,
)),
DirListEntry::Dir(
DirList::read_internal(root, **path, recursive, filter)
.to_resolved()
.await?,
),
);
}
}
......@@ -119,7 +121,7 @@ impl DirList {
for (k, entry) in &*dir {
match entry {
DirListEntry::File(path) => {
list.insert(k.clone(), *path);
list.insert(k.clone(), **path);
}
DirListEntry::Dir(d) => {
queue.push_back(d.await?);
......
......@@ -10,7 +10,7 @@ use anyhow::{bail, Result};
pub use node_entry::{NodeEntry, NodeRenderingEntries, NodeRenderingEntry};
use turbo_tasks::{
graph::{AdjacencyMap, GraphTraversal},
Completion, Completions, FxIndexSet, RcStr, TryJoinIterExt, ValueToString, Vc,
Completion, Completions, FxIndexSet, RcStr, ResolvedVc, TryJoinIterExt, ValueToString, Vc,
};
use turbo_tasks_env::ProcessEnv;
use turbo_tasks_fs::{to_sys_path, File, FileSystemPath};
......@@ -127,14 +127,14 @@ pub async fn external_asset_entrypoints(
/// assets.
#[turbo_tasks::function]
async fn separate_assets(
intermediate_asset: Vc<Box<dyn OutputAsset>>,
intermediate_asset: ResolvedVc<Box<dyn OutputAsset>>,
intermediate_output_path: Vc<FileSystemPath>,
) -> Result<Vc<SeparatedAssets>> {
let intermediate_output_path = &*intermediate_output_path.await?;
#[derive(PartialEq, Eq, Hash, Clone, Copy)]
enum Type {
Internal(Vc<Box<dyn OutputAsset>>),
External(Vc<Box<dyn OutputAsset>>),
Internal(ResolvedVc<Box<dyn OutputAsset>>),
External(ResolvedVc<Box<dyn OutputAsset>>),
}
let get_asset_children = |asset| async move {
let Type::Internal(asset) = asset else {
......@@ -155,9 +155,9 @@ async fn separate_assets(
.await?
.is_inside_ref(intermediate_output_path)
{
Ok(Type::Internal(*asset))
Ok(Type::Internal(asset.to_resolved().await?))
} else {
Ok(Type::External(*asset))
Ok(Type::External(asset.to_resolved().await?))
}
})
.try_join()
......@@ -177,10 +177,10 @@ async fn separate_assets(
for item in graph.into_reverse_topological() {
match item {
Type::Internal(asset) => {
internal_assets.insert(asset);
internal_assets.insert(*asset);
}
Type::External(asset) => {
external_asset_entrypoints.insert(asset);
external_asset_entrypoints.insert(*asset);
}
}
}
......
......@@ -114,7 +114,7 @@ pub async fn render_static(
};
Ok(match first {
RenderItem::Response(response) => response,
RenderItem::Response(response) => *response,
RenderItem::Headers(data) => {
let body = stream.map(|item| match item {
Ok(RenderItem::BodyChunk(b)) => Ok(b),
......@@ -183,7 +183,7 @@ async fn static_error(
#[derive(Clone, Debug)]
#[turbo_tasks::value]
enum RenderItem {
Response(Vc<StaticResult>),
Response(ResolvedVc<StaticResult>),
Headers(ResponseHeaders),
BodyChunk(Bytes),
}
......@@ -317,7 +317,9 @@ async fn render_stream_internal(
RenderStaticIncomingMessage::Headers { data } => yield RenderItem::Headers(data),
RenderStaticIncomingMessage::Rewrite { path } => {
drop(guard);
yield RenderItem::Response(StaticResult::rewrite(RewriteBuilder::new(path).build()));
yield RenderItem::Response(
StaticResult::rewrite(RewriteBuilder::new(path).build()).to_resolved().await?
);
return;
}
RenderStaticIncomingMessage::Response {
......@@ -326,11 +328,13 @@ async fn render_stream_internal(
body,
} => {
drop(guard);
yield RenderItem::Response(StaticResult::content(
AssetContent::file(File::from(body).into()),
status_code,
Vc::cell(headers),
));
yield RenderItem::Response(
StaticResult::content(
AssetContent::file(File::from(body).into()),
status_code,
Vc::cell(headers),
).to_resolved().await?
);
return;
}
RenderStaticIncomingMessage::Error(error) => {
......@@ -349,7 +353,7 @@ async fn render_stream_internal(
static_error(path, anyhow!(trace), Some(operation), fallback_page).await?,
500,
HeaderList::empty(),
)
).to_resolved().await?
);
return;
}
......
......@@ -2,8 +2,8 @@ use anyhow::{bail, Context, Result};
use indoc::formatdoc;
use serde::{Deserialize, Serialize};
use turbo_tasks::{
fxindexmap, trace::TraceRawVcs, Completion, Completions, RcStr, TaskInput, TryFlatJoinIterExt,
Value, Vc,
fxindexmap, trace::TraceRawVcs, Completion, Completions, RcStr, ResolvedVc, TaskInput,
TryFlatJoinIterExt, Value, Vc,
};
use turbo_tasks_bytes::stream::SingleValue;
use turbo_tasks_fs::{
......@@ -164,7 +164,7 @@ impl Asset for PostCssTransformedAsset {
#[turbo_tasks::value]
struct ProcessPostCssResult {
content: Vc<AssetContent>,
assets: Vec<Vc<VirtualSource>>,
assets: Vec<ResolvedVc<VirtualSource>>,
}
#[turbo_tasks::function]
......@@ -458,7 +458,7 @@ impl PostCssTransformedAsset {
};
let FileContent::Content(content) = &*file.await? else {
return Ok(ProcessPostCssResult {
content: AssetContent::File(FileContent::NotFound.cell()).cell(),
content: AssetContent::File(*FileContent::NotFound.resolved_cell()).cell(),
assets: Vec::new(),
}
.cell());
......@@ -501,7 +501,7 @@ impl PostCssTransformedAsset {
let SingleValue::Single(val) = config_value.try_into_single().await? else {
// An error happened, which has already been converted into an issue.
return Ok(ProcessPostCssResult {
content: AssetContent::File(FileContent::NotFound.cell()).cell(),
content: AssetContent::File(*FileContent::NotFound.resolved_cell()).cell(),
assets: Vec::new(),
}
.cell());
......@@ -511,7 +511,7 @@ impl PostCssTransformedAsset {
// TODO handle SourceMap
let file = File::from(processed_css.css);
let assets = emitted_assets_to_virtual_sources(processed_css.assets);
let assets = emitted_assets_to_virtual_sources(processed_css.assets).await?;
let content = AssetContent::File(FileContent::Content(file).cell()).cell();
Ok(ProcessPostCssResult { content, assets }.cell())
}
......
use std::collections::BTreeMap;
use anyhow::Result;
use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;
use turbo_tasks::{RcStr, Vc};
use turbo_tasks::{RcStr, ResolvedVc, TryJoinIterExt};
use turbo_tasks_fs::{File, FileContent, FileSystem};
use turbopack_core::{
asset::AssetContent, server_fs::ServerFileSystem, virtual_source::VirtualSource,
......@@ -16,9 +17,9 @@ pub struct EmittedAsset {
source_map: Option<JsonValue>,
}
pub fn emitted_assets_to_virtual_sources(
pub async fn emitted_assets_to_virtual_sources(
assets: Option<Vec<EmittedAsset>>,
) -> Vec<Vc<VirtualSource>> {
) -> Result<Vec<ResolvedVc<VirtualSource>>> {
assets
.into_iter()
.flatten()
......@@ -38,6 +39,8 @@ pub fn emitted_assets_to_virtual_sources(
ServerFileSystem::new().root().join(file),
AssetContent::File(FileContent::Content(File::from(content)).cell()).cell(),
)
.to_resolved()
})
.collect()
.try_join()
.await
}
......@@ -268,7 +268,11 @@ impl WebpackLoadersProcessedAsset {
Either::Left(str) => File::from(str),
Either::Right(bytes) => File::from(bytes.binary),
};
let assets = emitted_assets_to_virtual_sources(processed.assets);
let assets = emitted_assets_to_virtual_sources(processed.assets)
.await?
.into_iter()
.map(|asset| *asset)
.collect();
let content = AssetContent::File(FileContent::Content(file).cell()).cell();
Ok(ProcessWebpackLoadersResult {
content,
......
use anyhow::Result;
use turbo_tasks::{RcStr, ValueDefault, Vc};
use turbo_tasks::{RcStr, ResolvedVc, ValueDefault, Vc};
use turbo_tasks_fs::FileSystemPath;
use turbopack_core::{
condition::ContextCondition,
......@@ -14,7 +14,7 @@ use turbopack_core::{
#[derive(Default, Clone)]
pub struct ResolveOptionsContext {
#[serde(default)]
pub emulate_environment: Option<Vc<Environment>>,
pub emulate_environment: Option<ResolvedVc<Environment>>,
#[serde(default)]
pub enable_types: bool,
#[serde(default)]
......
......@@ -98,7 +98,9 @@ fn bench_emit(b: &mut Bencher, bench_input: &BenchInput) {
}
.cell(),
ResolveOptionsContext {
emulate_environment: Some(compile_time_info.environment().resolve().await?),
emulate_environment: Some(
compile_time_info.environment().to_resolved().await?,
),
..Default::default()
}
.cell(),
......
......@@ -51,7 +51,7 @@ impl AggregatedGraph {
for reference in asset.references().await?.iter() {
let reference = reference.resolve().await?;
if asset != reference.to_resolved().await? {
refs.insert(AggregatedGraph::leaf(reference));
refs.insert(AggregatedGraph::leaf(reference).to_resolved().await?);
}
}
AggregatedGraphsSet { set: refs }.into()
......@@ -64,7 +64,7 @@ impl AggregatedGraph {
.collect::<Vec<_>>()
.into_iter()
{
set.insert(item.resolve().await?);
set.insert(item.to_resolved().await?);
}
AggregatedGraphsSet { set }.into()
}
......@@ -152,20 +152,20 @@ async fn aggregate_more(node: Vc<AggregatedGraph>) -> Result<Vc<AggregatedGraph>
for valued_refs in valued_refs {
let valued_refs = valued_refs.await?;
for &reference in valued_refs.inner.iter() {
content.insert(reference);
content.insert(*reference);
}
for &reference in valued_refs.references.iter() {
if content.contains(&reference) {
continue;
}
references.insert(reference);
references.insert(*reference);
}
for &reference in valued_refs.outer.iter() {
if content.contains(&reference) {
continue;
}
references.remove(&reference);
in_progress.insert(reference);
in_progress.insert(*reference);
}
}
}
......@@ -182,7 +182,7 @@ async fn aggregate_more(node: Vc<AggregatedGraph>) -> Result<Vc<AggregatedGraph>
#[turbo_tasks::value(shared)]
struct AggregatedGraphsSet {
pub set: HashSet<Vc<AggregatedGraph>>,
pub set: HashSet<ResolvedVc<AggregatedGraph>>,
}
#[turbo_tasks::value(shared)]
......@@ -193,7 +193,7 @@ pub enum AggregatedGraphNodeContent {
#[turbo_tasks::value(shared)]
struct AggregatedGraphsValuedReferences {
pub inner: HashSet<Vc<AggregatedGraph>>,
pub outer: HashSet<Vc<AggregatedGraph>>,
pub references: HashSet<Vc<AggregatedGraph>>,
pub inner: HashSet<ResolvedVc<AggregatedGraph>>,
pub outer: HashSet<ResolvedVc<AggregatedGraph>>,
pub references: HashSet<ResolvedVc<AggregatedGraph>>,
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment