diff --git a/Cargo.lock b/Cargo.lock index f34c849b1..59bcee31c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,7 +451,7 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "comemo" version = "0.4.0" -source = "git+https://github.com/typst/comemo?rev=418f02b#418f02b58ce10e09abf0bcba92437e05f284294f" +source = "git+https://github.com/typst/comemo?rev=33e6bf6#33e6bf67f0867c3c83c432dfaf210869121a01e1" dependencies = [ "comemo-macros", "parking_lot", @@ -462,7 +462,7 @@ dependencies = [ [[package]] name = "comemo-macros" version = "0.4.0" -source = "git+https://github.com/typst/comemo?rev=418f02b#418f02b58ce10e09abf0bcba92437e05f284294f" +source = "git+https://github.com/typst/comemo?rev=33e6bf6#33e6bf67f0867c3c83c432dfaf210869121a01e1" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 2ef14a00e..effaae47a 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 = "418f02b" } +comemo = { git = "https://github.com/typst/comemo", rev = "33e6bf6" } diff --git a/crates/typst/src/lib.rs b/crates/typst/src/lib.rs index 7ee8c19a4..a019e2c1e 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}; use ecow::{EcoString, EcoVec, eco_format, eco_vec}; @@ -135,11 +135,10 @@ fn compile_impl( subsink = Sink::new(); - let constraint = Mutex::new(comemo::Constraint::new()); - let push = |call, ret| constraint.lock().unwrap().push(call, ret); + let constraint = comemo::Constraint::new(); let mut engine = Engine { world, - introspector: introspector.track_with(&push), + introspector: introspector.track_with(&constraint), traced, sink: subsink.track_mut(), route: Route::default(), @@ -151,10 +150,7 @@ fn compile_impl( introspector = document.introspector(); iter += 1; - if timed!( - "check stabilized", - constraint.into_inner().unwrap().validate(introspector) - ) { + if timed!("check stabilized", constraint.validate(introspector)) { break; }