Skip to content

Commit df40f80

Browse files
committed
Make StdError identical to core::error::Error on feature="unstable"
1 parent e7060ba commit df40f80

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎serde/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
// discussion of these features please refer to this issue:
8989
//
9090
// https://github.com/serde-rs/serde/issues/812
91-
#![cfg_attr(feature = "unstable", feature(never_type))]
91+
#![cfg_attr(feature = "unstable", feature(error_in_core, never_type))]
9292
#![allow(unknown_lints, bare_trait_objects, deprecated)]
9393
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
9494
// Ignored clippy and clippy_pedantic lints
@@ -303,7 +303,7 @@ use self::__private as private;
303303
#[path = "de/seed.rs"]
304304
mod seed;
305305

306-
#[cfg(not(feature = "std"))]
306+
#[cfg(not(any(feature = "std", feature = "unstable")))]
307307
mod std_error;
308308

309309
// Re-export #[derive(Serialize, Deserialize)].

‎serde/src/ser/mod.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,13 @@ mod impossible;
115115

116116
pub use self::impossible::Impossible;
117117

118+
#[cfg(all(feature = "unstable", not(feature = "std")))]
119+
#[doc(inline)]
120+
pub use core::error::Error as StdError;
118121
#[cfg(feature = "std")]
119122
#[doc(no_inline)]
120123
pub use std::error::Error as StdError;
121-
#[cfg(not(feature = "std"))]
124+
#[cfg(not(any(feature = "std", feature = "unstable")))]
122125
#[doc(no_inline)]
123126
pub use std_error::Error as StdError;
124127

0 commit comments

Comments
 (0)