mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
## What Clean up the Lazy-locks we re-export or use internally in the turbo-tasks crates, migrating to `std::sync::LazyLock` / `std::cell::LazyCell` where still needed and eliminating a couple of them where they weren't. ## Why One less dep, using standard Rust features, a smaller number of Lazy items. ## Details - **Re-exports:** drop unused `macro_helpers::OnceCell` and the now-unused `macro_helpers::phf` (since `TraitType` no longer stores a `phf::Map`). Replace `once_cell::sync::Lazy` with `std::sync::LazyLock` in `macro_helpers::TRAIT_CAST_FNS` and in the two macro-generated call sites. - **`once_cell::sync::Lazy` → `std::sync::LazyLock`** in `scope.rs`, `registry/mod.rs`, and `turbo-tasks-backend-fuzz`'s `graph.rs`. - **`once_cell::unsync::Lazy` → `std::cell::LazyCell`** in `update_cell.rs`. - **`TRAIT_METHOD` → plain const-init static:** `TraitType::methods` changes from `phf::Map<&'static str, TraitMethod>` to `&'static [TraitMethod]` (parallel to `method_names`), and `TraitType::get` becomes a `const fn` that does `index_of_name` + array indexing. The `value_trait` macro now emits a slice literal instead of `phf_map!`, and the `function` macro emits `static TRAIT_METHOD: &'static TraitMethod = TRAIT.get(stringify!(..));` — evaluated at const-eval time rather than behind a `LazyLock<&TraitMethod>`. - **Dropped `once_cell` and `phf` Cargo deps** from `turbo-tasks`, and `once_cell` from `turbo-tasks-backend` and its fuzz crate.
39 lines
782 B
TOML
39 lines
782 B
TOML
[package]
|
|
name = "turbo-tasks-backend-fuzz"
|
|
version = "0.0.0"
|
|
publish = false
|
|
edition = "2024"
|
|
|
|
[package.metadata]
|
|
cargo-fuzz = true
|
|
|
|
[dependencies]
|
|
afl = "0.15.18"
|
|
anyhow = { workspace = true }
|
|
arbitrary = { version = "1.4.1", features = ["derive"] }
|
|
bincode = { workspace = true }
|
|
libfuzzer-sys = "0.4.9"
|
|
serde = { workspace = true }
|
|
tokio = { workspace = true, features = ["full"] }
|
|
turbo-tasks = { workspace = true, features = ["non_operation_vc_strongly_consistent"] }
|
|
turbo-tasks-backend = { workspace = true }
|
|
turbo-tasks-malloc = { workspace = true }
|
|
|
|
[[bin]]
|
|
name = "fuzz_graph"
|
|
path = "fuzz_targets/graph.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
[[bin]]
|
|
name = "afl_graph"
|
|
path = "afl_targets/graph.rs"
|
|
test = false
|
|
doc = false
|
|
bench = false
|
|
|
|
|
|
[lints]
|
|
workspace = true
|