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 <flokli@flokli.de>
This commit is contained in:
Vincent Ambo 2024-02-20 15:38:33 +07:00 committed by tazjin
parent 3c87687798
commit 94f582341e
5 changed files with 22 additions and 33 deletions

View file

@ -323,12 +323,7 @@ fn eval(model: &Model) -> Output {
if !result.errors.is_empty() {
for error in &result.errors {
writeln!(
&mut out.errors,
"{}\n",
error.fancy_format_str(&source).trim(),
)
.unwrap();
writeln!(&mut out.errors, "{}\n", error.fancy_format_str().trim(),).unwrap();
}
return out;