From 46b781d8b89bccceef3df6678df5dfe3657f44b8 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 24 Jul 2025 14:56:08 +0200 Subject: [PATCH] Try daaa9c9 (no parking_lot) --- Cargo.lock | 7 ++----- Cargo.toml | 2 +- crates/typst-library/src/engine.rs | 2 +- .../typst-library/src/introspection/locator.rs | 2 +- crates/typst/src/lib.rs | 16 ++++------------ 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 932957e41..dd6dfad4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,19 +451,16 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "comemo" version = "0.4.0" -source = "git+https://github.com/typst/comemo?rev=a5028dd#a5028ddcebeab5d73c9e1688c9c913231172a9e9" +source = "git+https://github.com/typst/comemo?rev=daaa9c9#daaa9c96c7ea59805a149dafd13da48c48d5d6e1" dependencies = [ - "bumpalo", "comemo-macros", - "once_cell", - "parking_lot", "siphasher", ] [[package]] name = "comemo-macros" version = "0.4.0" -source = "git+https://github.com/typst/comemo?rev=a5028dd#a5028ddcebeab5d73c9e1688c9c913231172a9e9" +source = "git+https://github.com/typst/comemo?rev=daaa9c9#daaa9c96c7ea59805a149dafd13da48c48d5d6e1" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 5a8529894..6c83e751b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -165,4 +165,4 @@ uninlined_format_args = "warn" wildcard_in_or_patterns = "allow" [patch.crates-io] -comemo = { git = "https://github.com/typst/comemo", rev = "a5028dd" } +comemo = { git = "https://github.com/typst/comemo", rev = "daaa9c9" } diff --git a/crates/typst-library/src/engine.rs b/crates/typst-library/src/engine.rs index af12e9136..cb98f4599 100644 --- a/crates/typst-library/src/engine.rs +++ b/crates/typst-library/src/engine.rs @@ -219,7 +219,7 @@ pub struct Route<'a> { // We need to override the constraint's lifetime here so that `Tracked` is // covariant over the constraint. If it becomes invariant, we're in for a // world of lifetime pain. - outer: Option as Validate>::Call>>, + outer: Option as Validate>::Constraint>>, /// This is set if this route segment was inserted through the start of a /// module evaluation. id: Option, diff --git a/crates/typst-library/src/introspection/locator.rs b/crates/typst-library/src/introspection/locator.rs index 9b28e5236..3ba3d6486 100644 --- a/crates/typst-library/src/introspection/locator.rs +++ b/crates/typst-library/src/introspection/locator.rs @@ -312,7 +312,7 @@ enum LinkKind<'a> { /// We need to override the constraint's lifetime here so that `Tracked` is /// covariant over the constraint. If it becomes invariant, we're in for a /// world of lifetime pain. - Outer(Tracked<'a, Locator<'a>, as Validate>::Call>), + Outer(Tracked<'a, Locator<'a>, as Validate>::Constraint>), /// A link which indicates that we are in measurement mode. Measure(Location), } diff --git a/crates/typst/src/lib.rs b/crates/typst/src/lib.rs index c3db27f54..47e5531fd 100644 --- a/crates/typst/src/lib.rs +++ b/crates/typst/src/lib.rs @@ -39,7 +39,7 @@ pub use typst_syntax as syntax; pub use typst_utils as utils; use std::collections::HashSet; -use std::sync::{LazyLock, Mutex}; +use std::sync::LazyLock; use comemo::{Track, Tracked, Validate}; use ecow::{EcoString, EcoVec, eco_format, eco_vec}; @@ -135,11 +135,10 @@ fn compile_impl( subsink = Sink::new(); - let calls = Mutex::new(Vec::new()); - let tracker = |call, hash| calls.lock().unwrap().push((call, hash)); + let constraint = ::Constraint::new(); let mut engine = Engine { world, - introspector: introspector.track_with(&tracker), + introspector: introspector.track_with(&constraint), traced, sink: subsink.track_mut(), route: Route::default(), @@ -151,14 +150,7 @@ fn compile_impl( introspector = document.introspector(); iter += 1; - if timed!( - "check stabilized", - calls - .into_inner() - .unwrap() - .into_iter() - .all(|(call, hash)| introspector.call(call) == hash) - ) { + if timed!("check stabilized", introspector.validate(&constraint)) { break; }