Use Display for formatter parse errors (#9316)
## Summary This helps a bit with (but does not close) the issues described in https://github.com/astral-sh/ruff/issues/9311. E.g., now, we at least see: `error: Failed to format main.py: source contains syntax errors: invalid syntax. Got unexpected token '=' at byte offset 20`.
This commit is contained in:
@@ -305,12 +305,6 @@ impl fmt::Display for ParseError {
|
||||
}
|
||||
}
|
||||
|
||||
impl ParseError {
|
||||
pub fn error(self) -> ParseErrorType {
|
||||
self.error
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the different types of errors that can occur during parsing.
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum ParseErrorType {
|
||||
|
||||
Reference in New Issue
Block a user