From 9e0c93ed9d85bb68cf766cf5c353d70a81e5c00f Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 1 Feb 2026 08:36:13 +0100 Subject: [PATCH 1/2] Now always implementing core error instead of std erro --- src/tokenizer.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 8c33ad3dc8..c15c85042a 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>, From 95781ce7169fc93a444be478bf693de7b0c7ad41 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 1 Feb 2026 08:38:42 +0100 Subject: [PATCH 2/2] Removed other instances where std Error was implemented instead of core Error --- src/parser/mod.rs | 3 +-- src/tokenizer.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 2763114314..dbdce02dc0 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 c15c85042a..506dee1d7a 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -2553,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");