-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(turbo-tasks): Ignore fields annotated with `#[turbo_tasks(trace_…
…ignore)]` (#70375) This annotation implies that the field does not contain any `Vc` types, so we can re-use that here. We can skip checking for `ResolvedValue` on these fields. As we start codemodding stuff, we should consider renaming this annotation to something more generic (e.g. `#[turbo_tasks(does_not_contain_vc)]`), but this is good enough for now.
- Loading branch information
Showing
3 changed files
with
32 additions
and
10 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
turbopack/crates/turbo-tasks-macros-tests/tests/derive_resolved_value/pass_ignore_field.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::marker::PhantomData; | ||
|
||
use turbo_tasks::ResolvedValue; | ||
|
||
struct UnannotatedValue<T>(PhantomData<T>); | ||
|
||
#[derive(ResolvedValue)] | ||
struct ContainsIgnore<T> { | ||
#[turbo_tasks(trace_ignore)] | ||
a: UnannotatedValue<T>, | ||
} | ||
|
||
fn main() { | ||
let _ = ContainsIgnore { | ||
a: UnannotatedValue(PhantomData::<u32>), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters