Skip to content

Commit 628848b

Browse files
committed
Don't duplicate line numbers when annotating internal errors
Closes 5463 The `annotate_snippets` crate adds line number and column info to the output, so we don't need to append the line number to the `origin`. Previously, internal errors would be output with the line number twice. See how 478 is duplicated in the example below. ``` error[internal]: line formatted, but exceeded maximum width --> /path/to/file.rs:478:478:101 ``` Now the line number is not duplicated. ``` error[internal]: line formatted, but exceeded maximum width --> /path/to/file.rs:478:101 ```
1 parent ea017d7 commit 628848b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/format_report_formatter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl<'a> Display for FormatReportFormatter<'a> {
7878
None
7979
};
8080

81-
let origin = format!("{}:{}", file, error.line);
81+
let origin = file.to_string();
8282
let slice = Slice {
8383
source: &error.line_buffer.clone(),
8484
line_start: error.line,

0 commit comments

Comments
 (0)