Skip to content

Commit 0e89e3b

Browse files
Mark-Simulacrumtopecongiro
authored andcommitted
Print out error message and file when detecting that rust parser panicked (#3972)
1 parent e3bb1c1 commit 0e89e3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/formatting.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ fn format_project<T: FormatHandler>(
7676
Err(e) => {
7777
let forbid_verbose = input_is_stdin || e != ParserError::ParsePanicError;
7878
should_emit_verbose(forbid_verbose, config, || {
79-
eprintln!("The Rust parser panicked");
79+
eprintln!(
80+
"The Rust parser panicked while parsing input: {:?}: {:?}",
81+
main_file, e
82+
);
8083
});
8184
report.add_parsing_error();
8285
return Ok(report);

0 commit comments

Comments
 (0)