From 92d686f9a536d4b3d3ede61e65d2f883a7bc4ed4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 28 Jul 2023 15:58:57 -0700 Subject: [PATCH 1/2] Fix serde::de::StdError in no-std unstable build --- serde/src/de/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/serde/src/de/mod.rs b/serde/src/de/mod.rs index a04ecf77d..b53206bdf 100644 --- a/serde/src/de/mod.rs +++ b/serde/src/de/mod.rs @@ -126,10 +126,13 @@ mod utf8; pub use self::ignored_any::IgnoredAny; +#[cfg(all(feature = "unstable", not(feature = "std")))] +#[doc(no_inline)] +pub use core::error::Error as StdError; #[cfg(feature = "std")] #[doc(no_inline)] pub use std::error::Error as StdError; -#[cfg(not(feature = "std"))] +#[cfg(not(any(feature = "std", feature = "unstable")))] #[doc(no_inline)] pub use std_error::Error as StdError; From ff5442cd9ea48fd3913700bb3ddb7f1a72c9b2c3 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 28 Jul 2023 16:00:07 -0700 Subject: [PATCH 2/2] Add no-std unstable build in CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6652aad73..d67039ce3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,7 @@ jobs: - run: cd serde && cargo build --no-default-features - run: cd serde && cargo build --no-default-features --features alloc - run: cd serde && cargo build --no-default-features --features rc,alloc + - run: cd serde && cargo build --no-default-features --features unstable - run: cd serde && cargo test --features derive,rc,unstable - run: cd test_suite/no_std && cargo build if: matrix.os != 'windows'