From 94f582341e4f37228fbdf0997255d6374264b4b3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 20 Feb 2024 15:38:33 +0700 Subject: refactor(tvix/eval): use internal SourceCode field in error printers Makes use of the SourceCode field now being stored directly in errors (see parent CL). With this change, the default `Display` implementation can now format errors correctly, and there is no need to keep a `SourceCode` around just for error formatting. Updates dependent crates (CLI, serde, tvixbolt) to use this correctly. Change-Id: Iddc5d7a6b4bab391f30a999e4c68aca34304c059 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10987 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/cli/src/main.rs') diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 65f5d5363c1d..d765fa98392c 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -159,7 +159,7 @@ fn interpret(code: &str, path: Option, args: &Args, explain: bool) -> b } for error in &result.errors { - error.fancy_format_stderr(&source_map); + error.fancy_format_stderr(); } if !args.no_warnings { @@ -207,7 +207,7 @@ fn lint(code: &str, path: Option, args: &Args) -> bool { } for error in &result.errors { - error.fancy_format_stderr(&source_map); + error.fancy_format_stderr(); } for warning in &result.warnings { -- cgit 1.4.1