Skip to content

Commit e0e2f0d

Browse files
beneschtopecongiro
authored andcommitted
Don't panic on license check errors (#3655)
Without this case, an ErrorKind::LicenseCheck results in a panic: thread 'main' panicked at 'internal error: entered unreachable code', src/tools/rustfmt/src/formatting.rs:320:18 N.B.: errors of this type are only raised when the configuration file contains `license_tempate_path = "TEMPLATE_FILE"`.
1 parent c955b59 commit e0e2f0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/formatting.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ impl FormattingError {
313313
| ErrorKind::DeprecatedAttr
314314
| ErrorKind::BadIssue(_)
315315
| ErrorKind::BadAttr
316-
| ErrorKind::LostComment => {
316+
| ErrorKind::LostComment
317+
| ErrorKind::LicenseCheck => {
317318
let trailing_ws_start = self
318319
.line_buffer
319320
.rfind(|c: char| !c.is_whitespace())

0 commit comments

Comments
 (0)