Fix trivial no_std-breaking issues.

This commit is contained in:
Brian Smith 2018-12-27 08:40:50 -10:00
parent abe7b2d7d5
commit 7ad3bb79f9
4 changed files with 8 additions and 2 deletions

View File

@ -22,7 +22,7 @@ use crate::{c, error};
#[repr(transparent)]
pub struct Result(c::int);
impl From<Result> for ::std::result::Result<(), error::Unspecified> {
impl From<Result> for core::result::Result<(), error::Unspecified> {
fn from(ret: Result) -> Self {
match ret.0 {
1 => Ok(()),

View File

@ -180,6 +180,7 @@ impl std::error::Error for KeyRejected {
fn description(&self) -> &str { self.description_() }
}
#[cfg(feature = "use_heap")]
impl std::fmt::Display for KeyRejected {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.write_str(self.description_())

View File

@ -113,6 +113,7 @@ mod rsa;
pub mod signature;
#[cfg(any(test, feature = "use_heap"))]
pub mod test;
mod sealed {

View File

@ -93,7 +93,10 @@ impl SecureRandom for SystemRandom {
impl sealed::Sealed for SystemRandom {}
#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "ios", windows)))]
#[cfg(all(
feature = "use_heap",
not(any(target_os = "linux", target_os = "macos", target_os = "ios", windows))
))]
use self::urandom::fill as fill_impl;
#[cfg(any(
@ -182,6 +185,7 @@ mod sysrand {
// Keep the `cfg` conditions in sync with the conditions in lib.rs.
#[cfg(all(
feature = "use_heap",
any(target_os = "redox", unix),
not(any(target_os = "macos", target_os = "ios")),
not(all(target_os = "linux", not(feature = "dev_urandom_fallback")))