diff --git a/benchmarks/benches/dataset.rs b/benchmarks/benches/dataset.rs index eb8f1ee25..c02ba7654 100644 --- a/benchmarks/benches/dataset.rs +++ b/benchmarks/benches/dataset.rs @@ -1,6 +1,6 @@ +use core::error::Error; use criterion::{criterion_group, criterion_main, Criterion}; use prost::Message; -use std::error::Error; pub mod benchmarks { include!(concat!(env!("OUT_DIR"), "/benchmarks.rs")); diff --git a/prost-types/src/duration.rs b/prost-types/src/duration.rs index 5b5f8531f..e127fc501 100644 --- a/prost-types/src/duration.rs +++ b/prost-types/src/duration.rs @@ -164,8 +164,7 @@ impl fmt::Display for DurationError { } } -#[cfg(feature = "std")] -impl std::error::Error for DurationError {} +impl core::error::Error for DurationError {} impl FromStr for Duration { type Err = DurationError; diff --git a/prost-types/src/timestamp.rs b/prost-types/src/timestamp.rs index 19bd7b734..2a22e76ec 100644 --- a/prost-types/src/timestamp.rs +++ b/prost-types/src/timestamp.rs @@ -185,8 +185,7 @@ impl fmt::Display for TimestampError { } } -#[cfg(feature = "std")] -impl std::error::Error for TimestampError {} +impl core::error::Error for TimestampError {} #[cfg(feature = "std")] impl TryFrom for std::time::SystemTime { diff --git a/prost/src/error.rs b/prost/src/error.rs index 280a96ce3..e20345c89 100644 --- a/prost/src/error.rs +++ b/prost/src/error.rs @@ -145,8 +145,7 @@ impl fmt::Display for DecodeErrorKind { } } -#[cfg(feature = "std")] -impl std::error::Error for DecodeError {} +impl core::error::Error for DecodeError {} #[cfg(feature = "std")] impl From for std::io::Error { @@ -196,8 +195,7 @@ impl fmt::Display for EncodeError { } } -#[cfg(feature = "std")] -impl std::error::Error for EncodeError {} +impl core::error::Error for EncodeError {} #[cfg(feature = "std")] impl From for std::io::Error { @@ -220,8 +218,7 @@ impl fmt::Display for UnknownEnumValue { } } -#[cfg(feature = "std")] -impl std::error::Error for UnknownEnumValue {} +impl core::error::Error for UnknownEnumValue {} #[cfg(test)] mod test {