This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 37aa7922 Implement `core::error::Error` for `ParserError` and
`TokenizerError` (#2189)
37aa7922 is described below
commit 37aa792277089de6dbcf01823d7db5e9029ce5c7
Author: Luca Cappelletti <[email protected]>
AuthorDate: Mon Feb 2 09:38:44 2026 +0100
Implement `core::error::Error` for `ParserError` and `TokenizerError`
(#2189)
---
src/parser/mod.rs | 3 +--
src/tokenizer.rs | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index 27631143..dbdce02d 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -204,8 +204,7 @@ impl fmt::Display for ParserError {
}
}
-#[cfg(feature = "std")]
-impl std::error::Error for ParserError {}
+impl core::error::Error for ParserError {}
// By default, allow expressions up to this deep before erroring
const DEFAULT_REMAINING_DEPTH: usize = 50;
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 8c33ad3d..506dee1d 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -782,8 +782,7 @@ impl fmt::Display for TokenizerError {
}
}
-#[cfg(feature = "std")]
-impl std::error::Error for TokenizerError {}
+impl core::error::Error for TokenizerError {}
struct State<'a> {
peekable: Peekable<Chars<'a>>,
@@ -2554,9 +2553,8 @@ mod tests {
message: "test".into(),
location: Location { line: 1, column: 1 },
};
- #[cfg(feature = "std")]
{
- use std::error::Error;
+ use core::error::Error;
assert!(err.source().is_none());
}
assert_eq!(err.to_string(), "test at Line: 1, Column: 1");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]