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"`.
This commit is contained in:
parent
c955b5908e
commit
e0e2f0db53
@ -313,7 +313,8 @@ impl FormattingError {
|
||||
| ErrorKind::DeprecatedAttr
|
||||
| ErrorKind::BadIssue(_)
|
||||
| ErrorKind::BadAttr
|
||||
| ErrorKind::LostComment => {
|
||||
| ErrorKind::LostComment
|
||||
| ErrorKind::LicenseCheck => {
|
||||
let trailing_ws_start = self
|
||||
.line_buffer
|
||||
.rfind(|c: char| !c.is_whitespace())
|
||||
|
Loading…
x
Reference in New Issue
Block a user