From 545e84bcb0f235b12e21351e0c69767958efe2a7 Mon Sep 17 00:00:00 2001 From: Brendan Molloy Date: Sat, 29 Jan 2022 13:38:29 +0100 Subject: [PATCH] Bump version to 0.4.0 Re-exports std::io and std::error in 'std' feature --- Cargo.toml | 2 +- src/error.rs | 2 ++ src/lib.rs | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bc2d203..68e2fef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "core2" -version = "0.3.3" +version = "0.4.0" authors = ["Brendan Molloy "] description = "The bare essentials of std::io for use in no_std. Alloc support is optional." license = "Apache-2.0 OR MIT" diff --git a/src/error.rs b/src/error.rs index 1972cf8..2fc4fa6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,6 +11,7 @@ // coherence challenge (e.g., specialization, neg impls, etc) we can // reconsider what crate these items belong in. +#[allow(deprecated)] use core::alloc::LayoutErr; use core::any::TypeId; @@ -322,6 +323,7 @@ impl<'a> From> for Box { #[cfg(feature = "nightly")] impl Error for ! {} +#[allow(deprecated)] impl Error for LayoutErr {} impl Error for core::str::ParseBoolError {} diff --git a/src/lib.rs b/src/lib.rs index d3755a6..1016168 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,8 +4,17 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(feature = "std", allow(dead_code))] +#[cfg(not(feature = "std"))] pub mod error; + +#[cfg(feature = "std")] +pub use std::error as error; + +#[cfg(not(feature = "std"))] pub mod io; +#[cfg(feature = "std")] +pub use std::io as io; + #[cfg(feature = "alloc")] extern crate alloc;