Skip to content

Remove redundant unsafe_ignore annotations - #98961

Draft
lukesandberg wants to merge 2 commits into
remove-trace-raw-vcsfrom
reduce-unsafe-ignore
Draft

lukesandberg wants to merge 2 commits into
remove-trace-raw-vcsfrom
reduce-unsafe-ignore

Conversation

@lukesandberg

@lukesandberg lukesandberg commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

What?

Remove 54 redundant #[turbo_tasks(unsafe_ignore)] field annotations, reducing the field-annotation total from 136 to 82 (39.7%). Fields that no longer carry the exemption now participate in the generated NonLocalValue or OperationValue assertions.

This is stacked on #98953, which renames the former tracing attribute to unsafe_ignore and leaves it solely as a marker-trait assertion escape hatch.

Why?

Most annotations predated the removal of TraceRawVcs and were only needed to exclude fields from recursive VC tracing. Keeping those exemptions would unnecessarily bypass compile-time marker checks after tracing is gone.

The remaining annotations fall into these categories:

  • 47 foreign, standard-library, or runtime types that cannot receive marker implementations because of Rust's orphan rules
  • 29 workspace-local helper or state types that do not currently implement the marker
  • 4 unconstrained trait objects or opaque futures
  • 1 local OperationValue contract gap
  • 1 macro fixture that tests the exemption itself

The local helper/state group is the meaningful follow-up area; unlike foreign types, those types could gain separately reviewed marker implementations in their owning crates.

How?

Every field exemption was evaluated against the existing generated marker assertions. An annotation is removed only when the field already satisfies the appropriate marker bound. debug_ignore remains intact where it serves an independent purpose.

No new unsafe impl, wrapper type, macro opt-out, or weakened assertion is introduced, so this change removes redundant unsafety rather than relocating or widening it.

Verification

  • cargo check --workspace --all-targets
  • cargo fmt --all -- --check
  • cargo test -p turbo-tasks-macros-tests
  • cargo test --doc -p turbo-tasks

Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 97f43d6

Comment thread turbopack/crates/turbopack-node/src/process_pool/mod.rs
Comment thread turbopack/crates/turbopack-image/src/process/mod.rs
Comment thread turbopack/crates/turbopack-node/src/worker_pool/mod.rs
Comment thread turbopack/crates/turbopack-node/src/evaluate.rs
@lukesandberg
lukesandberg added this pull request to stack #98978 September 21, 2026 00:29
Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant