Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unstable build #2540

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions serde/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ mod utf8;

pub use self::ignored_any::IgnoredAny;

#[cfg(feature = "std")]
#[doc(no_inline)]
pub use std::error::Error as StdError;
#[cfg(not(feature = "std"))]
#[doc(no_inline)]
pub use std_error::Error as StdError;

Expand Down
1 change: 0 additions & 1 deletion serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ use self::__private as private;
#[path = "de/seed.rs"]
mod seed;

#[cfg(not(any(feature = "std", feature = "unstable")))]
mod std_error;

// Re-export #[derive(Serialize, Deserialize)].
Expand Down
7 changes: 0 additions & 7 deletions serde/src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@ mod impossible;

pub use self::impossible::Impossible;

#[cfg(all(feature = "unstable", not(feature = "std")))]
#[doc(inline)]
pub use core::error::Error as StdError;
#[cfg(feature = "std")]
#[doc(no_inline)]
pub use std::error::Error as StdError;
#[cfg(not(any(feature = "std", feature = "unstable")))]
#[doc(no_inline)]
pub use std_error::Error as StdError;

Expand Down
10 changes: 10 additions & 0 deletions serde/src/std_error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#[cfg(not(any(feature = "std", feature = "unstable")))]
use lib::{Debug, Display};

#[cfg(all(feature = "unstable", not(feature = "std")))]
#[doc(no_inline)]
pub use core::error::Error;

#[cfg(feature = "std")]
#[doc(no_inline)]
pub use std::error::Error;

/// Either a re-export of std::error::Error or a new identical trait, depending
/// on whether Serde's "std" feature is enabled.
///
Expand Down Expand Up @@ -40,6 +49,7 @@ use lib::{Debug, Display};
/// ```edition2021
/// impl serde::ser::StdError for MySerError {}
/// ```
#[cfg(not(any(feature = "std", feature = "unstable")))]
pub trait Error: Debug + Display {
/// The underlying cause of this error, if any.
fn source(&self) -> Option<&(Error + 'static)> {
Expand Down