diff --git a/crates/rlp/Cargo.toml b/crates/rlp/Cargo.toml index 4566314..41baeb5 100644 --- a/crates/rlp/Cargo.toml +++ b/crates/rlp/Cargo.toml @@ -36,6 +36,9 @@ derive = ["dep:alloy-rlp-derive"] # Enables `core::net::` implementations always instead of conditionally through `std`. # Requires Rust 1.77 or newer. core-net = [] +# Enables `core::error::Error` implementations always instead of conditionally through `std`. +# Requires Rust 1.81 or newer. +core-error = [] arrayvec = ["dep:arrayvec"] diff --git a/crates/rlp/src/error.rs b/crates/rlp/src/error.rs index 5eed183..b4844b5 100644 --- a/crates/rlp/src/error.rs +++ b/crates/rlp/src/error.rs @@ -33,6 +33,8 @@ pub enum Error { Custom(&'static str), } +#[cfg(all(feature = "core-net", not(feature = "std")))] +impl core::error::Error for Error {} #[cfg(feature = "std")] impl std::error::Error for Error {}