lib/cretonne works with no_std
This commit is contained in:
committed by
Dan Gohman
parent
7375088c3e
commit
299e8a9737
@@ -20,8 +20,11 @@ name = "cretonne"
|
||||
[dependencies.hashmap_core]
|
||||
version = "0.1.1"
|
||||
optional = true
|
||||
[dependencies.error_core]
|
||||
version = "0.1.0"
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
# Currently, the only feature is the `no_std` feature.
|
||||
# Enabling this disables use of `stdlib`.
|
||||
no_std = ["hashmap_core"]
|
||||
no_std = ["hashmap_core", "error_core"]
|
||||
@@ -9,6 +9,7 @@
|
||||
/// The output will appear in files named `cretonne.dbg.*`, where the suffix is named after the
|
||||
/// thread doing the logging.
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
use std::cell::RefCell;
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
use std::env;
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#[cfg(feature = "no_std")]
|
||||
extern crate hashmap_core;
|
||||
#[cfg(feature = "no_std")]
|
||||
extern crate error_core;
|
||||
#[cfg(feature = "no_std")]
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
@@ -72,9 +74,6 @@ mod std {
|
||||
pub use alloc::BTreeSet;
|
||||
}
|
||||
pub mod error {
|
||||
pub trait Error {
|
||||
fn description(&self) -> &str;
|
||||
fn cause(&self) -> Option<&Error> { None }
|
||||
}
|
||||
pub use error_core::Error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user