Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
5018dcfb
Commit
5018dcfb
authored
Oct 13, 2025
by
Tobias Koppers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: remove TaskInput from AutoSet
parent
90bc934b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
33 deletions
+27
-33
task_input.rs
turbopack/crates/turbo-tasks/src/task/task_input.rs
+5
-13
mod.rs
turbopack/crates/turbopack-core/src/issue/mod.rs
+22
-20
No files found.
turbopack/crates/turbo-tasks/src/task/task_input.rs
View file @
5018dcfb
...
@@ -19,6 +19,11 @@ use crate::{
...
@@ -19,6 +19,11 @@ use crate::{
/// Trait to implement in order for a type to be accepted as a
/// Trait to implement in order for a type to be accepted as a
/// [`#[turbo_tasks::function]`][crate::function] argument.
/// [`#[turbo_tasks::function]`][crate::function] argument.
///
/// Note that in addition to the trait bounds, the type must also be deterministic serializable when
/// used for a persisted task (is_transient = false). This means serialization of equal values
/// should lead to byte-identical results. This is not enforced by the trait itself, but is required
/// for correct behavior.
pub
trait
TaskInput
:
Send
+
Sync
+
Clone
+
Debug
+
PartialEq
+
Eq
+
Hash
+
TraceRawVcs
{
pub
trait
TaskInput
:
Send
+
Sync
+
Clone
+
Debug
+
PartialEq
+
Eq
+
Hash
+
TraceRawVcs
{
fn
resolve_input
(
&
self
)
->
impl
Future
<
Output
=
Result
<
Self
>>
+
Send
+
'_
{
fn
resolve_input
(
&
self
)
->
impl
Future
<
Output
=
Result
<
Self
>>
+
Send
+
'_
{
async
{
Ok
(
self
.clone
())
}
async
{
Ok
(
self
.clone
())
}
...
@@ -332,19 +337,6 @@ where
...
@@ -332,19 +337,6 @@ where
}
}
}
}
impl
<
T
>
TaskInput
for
auto_hash_map
::
AutoSet
<
T
>
where
T
:
TaskInput
,
{
fn
is_resolved
(
&
self
)
->
bool
{
self
.iter
()
.all
(
TaskInput
::
is_resolved
)
}
fn
is_transient
(
&
self
)
->
bool
{
self
.iter
()
.any
(
TaskInput
::
is_transient
)
}
}
macro_rules!
tuple_impls
{
macro_rules!
tuple_impls
{
(
$
(
$name:ident
)
+
)
=>
{
(
$
(
$name:ident
)
+
)
=>
{
impl
<
$
(
$name
:
TaskInput
),
+>
TaskInput
for
(
$
(
$name
,)
+
)
impl
<
$
(
$name
:
TaskInput
),
+>
TaskInput
for
(
$
(
$name
,)
+
)
...
...
turbopack/crates/turbopack-core/src/issue/mod.rs
View file @
5018dcfb
...
@@ -6,7 +6,6 @@ pub mod resolve;
...
@@ -6,7 +6,6 @@ pub mod resolve;
use
std
::{
use
std
::{
cmp
::
min
,
cmp
::
min
,
fmt
::{
Display
,
Formatter
},
fmt
::{
Display
,
Formatter
},
sync
::
Arc
,
};
};
use
anyhow
::{
Result
,
anyhow
};
use
anyhow
::{
Result
,
anyhow
};
...
@@ -164,9 +163,7 @@ pub trait ImportTracer {
...
@@ -164,9 +163,7 @@ pub trait ImportTracer {
fn
get_traces
(
self
:
Vc
<
Self
>
,
path
:
FileSystemPath
)
->
Vc
<
ImportTraces
>
;
fn
get_traces
(
self
:
Vc
<
Self
>
,
path
:
FileSystemPath
)
->
Vc
<
ImportTraces
>
;
}
}
#[derive(
#[turbo_tasks
::
value]
Debug,
Clone,
TaskInput,
TraceRawVcs,
Hash,
Eq,
PartialEq,
Serialize,
Deserialize,
NonLocalValue,
)]
pub
struct
DelegatingImportTracer
{
pub
struct
DelegatingImportTracer
{
delegates
:
AutoSet
<
ResolvedVc
<
Box
<
dyn
ImportTracer
>>>
,
delegates
:
AutoSet
<
ResolvedVc
<
Box
<
dyn
ImportTracer
>>>
,
}
}
...
@@ -220,7 +217,7 @@ pub struct Issues(Vec<ResolvedVc<Box<dyn Issue>>>);
...
@@ -220,7 +217,7 @@ pub struct Issues(Vec<ResolvedVc<Box<dyn Issue>>>);
#[derive(Debug)]
#[derive(Debug)]
pub
struct
CapturedIssues
{
pub
struct
CapturedIssues
{
issues
:
AutoSet
<
ResolvedVc
<
Box
<
dyn
Issue
>>>
,
issues
:
AutoSet
<
ResolvedVc
<
Box
<
dyn
Issue
>>>
,
tracer
:
Ar
c
<
DelegatingImportTracer
>
,
tracer
:
ResolvedV
c
<
DelegatingImportTracer
>
,
}
}
#[turbo_tasks
::
value_impl]
#[turbo_tasks
::
value_impl]
...
@@ -250,12 +247,10 @@ impl CapturedIssues {
...
@@ -250,12 +247,10 @@ impl CapturedIssues {
// Returns all the issues as formatted `PlainIssues`.
// Returns all the issues as formatted `PlainIssues`.
pub
async
fn
get_plain_issues
(
&
self
)
->
Result
<
Vec
<
ReadRef
<
PlainIssue
>>>
{
pub
async
fn
get_plain_issues
(
&
self
)
->
Result
<
Vec
<
ReadRef
<
PlainIssue
>>>
{
let
mut
list
=
let
mut
list
=
self
self
.issues
.issues
.iter
()
.iter
()
.map
(|
issue
|
async
move
{
.map
(|
issue
|
async
move
{
PlainIssue
::
from_issue
(
**
issue
,
Some
(
*
self
.tracer
))
.await
})
PlainIssue
::
from_issue
(
**
issue
,
Some
(
self
.tracer
.clone
()))
.await
})
.try_join
()
.try_join
()
.await
?
;
.await
?
;
list
.sort
();
list
.sort
();
...
@@ -716,7 +711,7 @@ impl PlainIssue {
...
@@ -716,7 +711,7 @@ impl PlainIssue {
#[turbo_tasks
::
function]
#[turbo_tasks
::
function]
pub
async
fn
from_issue
(
pub
async
fn
from_issue
(
issue
:
ResolvedVc
<
Box
<
dyn
Issue
>>
,
issue
:
ResolvedVc
<
Box
<
dyn
Issue
>>
,
import_tracer
:
Option
<
Ar
c
<
DelegatingImportTracer
>>
,
import_tracer
:
Option
<
ResolvedV
c
<
DelegatingImportTracer
>>
,
)
->
Result
<
Vc
<
Self
>>
{
)
->
Result
<
Vc
<
Self
>>
{
let
description
:
Option
<
StyledString
>
=
match
*
issue
.description
()
.await
?
{
let
description
:
Option
<
StyledString
>
=
match
*
issue
.description
()
.await
?
{
Some
(
description
)
=>
Some
(
description
.owned
()
.await
?
),
Some
(
description
)
=>
Some
(
description
.owned
()
.await
?
),
...
@@ -747,7 +742,12 @@ impl PlainIssue {
...
@@ -747,7 +742,12 @@ impl PlainIssue {
},
},
import_traces
:
match
import_tracer
{
import_traces
:
match
import_tracer
{
Some
(
tracer
)
=>
{
Some
(
tracer
)
=>
{
into_plain_trace
(
tracer
.get_traces
(
issue
.file_path
()
.owned
()
.await
?
)
.await
?
)
into_plain_trace
(
tracer
.await
?
.get_traces
(
issue
.file_path
()
.owned
()
.await
?
)
.await
?
,
)
.await
?
.await
?
}
}
None
=>
vec!
[],
None
=>
vec!
[],
...
@@ -835,9 +835,10 @@ where
...
@@ -835,9 +835,10 @@ where
CapturedIssues
{
CapturedIssues
{
issues
:
self
.peek_collectibles
(),
issues
:
self
.peek_collectibles
(),
tracer
:
Arc
::
new
(
DelegatingImportTracer
{
tracer
:
DelegatingImportTracer
{
delegates
:
self
.peek_collectibles
(),
delegates
:
self
.peek_collectibles
(),
}),
}
.resolved_cell
(),
}
}
}
}
...
@@ -845,9 +846,10 @@ where
...
@@ -845,9 +846,10 @@ where
CapturedIssues
{
CapturedIssues
{
issues
:
self
.take_collectibles
(),
issues
:
self
.take_collectibles
(),
tracer
:
Arc
::
new
(
DelegatingImportTracer
{
tracer
:
DelegatingImportTracer
{
delegates
:
self
.take_collectibles
(),
delegates
:
self
.take_collectibles
(),
}),
}
.resolved_cell
(),
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment