summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index d518a03b..a22d956d 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -239,9 +239,10 @@ fn print_diagnostics(
for error in errors {
// The main diagnostic.
- let diag = Diagnostic::error().with_message(error.message).with_labels(vec![
- Label::primary(error.span.source(), sources.range(error.span)),
- ]);
+ let range = sources.range(error.span);
+ let diag = Diagnostic::error()
+ .with_message(error.message)
+ .with_labels(vec![Label::primary(error.span.source(), range)]);
term::emit(&mut w, &config, sources, &diag)?;