Try 33e6bf6

This commit is contained in:
Laurenz 2025-07-29 15:02:26 +02:00
parent 6c28ef34c7
commit 2862d61944
3 changed files with 7 additions and 11 deletions

4
Cargo.lock generated
View File

@ -451,7 +451,7 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]] [[package]]
name = "comemo" name = "comemo"
version = "0.4.0" 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 = [ dependencies = [
"comemo-macros", "comemo-macros",
"parking_lot", "parking_lot",
@ -462,7 +462,7 @@ dependencies = [
[[package]] [[package]]
name = "comemo-macros" name = "comemo-macros"
version = "0.4.0" 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 = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -165,4 +165,4 @@ uninlined_format_args = "warn"
wildcard_in_or_patterns = "allow" wildcard_in_or_patterns = "allow"
[patch.crates-io] [patch.crates-io]
comemo = { git = "https://github.com/typst/comemo", rev = "418f02b" } comemo = { git = "https://github.com/typst/comemo", rev = "33e6bf6" }

View File

@ -39,7 +39,7 @@ pub use typst_syntax as syntax;
pub use typst_utils as utils; pub use typst_utils as utils;
use std::collections::HashSet; use std::collections::HashSet;
use std::sync::{LazyLock, Mutex}; use std::sync::LazyLock;
use comemo::{Track, Tracked}; use comemo::{Track, Tracked};
use ecow::{EcoString, EcoVec, eco_format, eco_vec}; use ecow::{EcoString, EcoVec, eco_format, eco_vec};
@ -135,11 +135,10 @@ fn compile_impl<D: Document>(
subsink = Sink::new(); subsink = Sink::new();
let constraint = Mutex::new(comemo::Constraint::new()); let constraint = comemo::Constraint::new();
let push = |call, ret| constraint.lock().unwrap().push(call, ret);
let mut engine = Engine { let mut engine = Engine {
world, world,
introspector: introspector.track_with(&push), introspector: introspector.track_with(&constraint),
traced, traced,
sink: subsink.track_mut(), sink: subsink.track_mut(),
route: Route::default(), route: Route::default(),
@ -151,10 +150,7 @@ fn compile_impl<D: Document>(
introspector = document.introspector(); introspector = document.introspector();
iter += 1; iter += 1;
if timed!( if timed!("check stabilized", constraint.validate(introspector)) {
"check stabilized",
constraint.into_inner().unwrap().validate(introspector)
) {
break; break;
} }