Update no_std support in cranelift-frontend.
This commit is contained in:
@@ -176,6 +176,9 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(not(feature = "std"), feature(alloc))]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
extern crate cranelift_codegen;
|
||||
#[cfg(test)]
|
||||
extern crate target_lexicon;
|
||||
@@ -191,10 +194,16 @@ mod ssa;
|
||||
mod switch;
|
||||
mod variable;
|
||||
|
||||
/// This replaces `std` in builds with `core`.
|
||||
#[cfg(not(feature = "std"))]
|
||||
mod std {
|
||||
extern crate alloc;
|
||||
|
||||
pub use self::alloc::vec;
|
||||
pub use alloc::{string, vec};
|
||||
pub use core::*;
|
||||
pub mod collections {
|
||||
#[allow(unused_extern_crates)]
|
||||
extern crate hashmap_core;
|
||||
|
||||
pub use self::hashmap_core::map as hash_map;
|
||||
pub use self::hashmap_core::{HashMap, HashSet};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user