From 26ae1d3c2768efcbb14be980ad0455c3640d0694 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:50:01 -0300 Subject: [PATCH] fix local sink on call warnings now get tracepoints --- crates/typst/src/eval/call.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/typst/src/eval/call.rs b/crates/typst/src/eval/call.rs index 11a59a787..d00f4225b 100644 --- a/crates/typst/src/eval/call.rs +++ b/crates/typst/src/eval/call.rs @@ -171,16 +171,16 @@ impl Eval for ast::FuncCall<'_> { // part of the call stack that led to the warning being raised, // thus allowing suppression of the warning through this call. let mut local_sink = Sink::new(); - let previous_sink = - std::mem::replace(&mut vm.engine.sink, local_sink.track_mut()); + let mut engine = Engine { + sink: local_sink.track_mut(), + route: vm.engine.route.clone(), + ..vm.engine + }; - let call_result = func.call(&mut vm.engine, vm.context, args).trace( - vm.world(), - point, - span, - ); + let call_result = + func.call(&mut engine, vm.context, args) + .trace(vm.world(), point, span); - std::mem::replace(&mut vm.engine.sink, previous_sink); local_sink.trace_warnings(vm.world(), point, span); // Push the accumulated warnings and other fields back to the