Update no_std support.

This commit is contained in:
Dan Gohman
2018-10-05 17:16:51 -07:00
parent 8bd0cf2533
commit 7f90414ae1
3 changed files with 9 additions and 2 deletions

View File

@@ -48,6 +48,8 @@
// Turns on no_std and alloc features if std is not available.
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc))]
// TODO: Remove this workaround once https://github.com/rust-lang/rust/issues/27747 is done.
#![cfg_attr(not(feature = "std"), feature(slice_concat_ext))]
#[cfg(not(feature = "std"))]
#[macro_use]
@@ -119,7 +121,7 @@ pub use result::{CodegenError, CodegenResult};
/// This replaces `std` in builds with `core`.
#[cfg(not(feature = "std"))]
mod std {
pub use alloc::{boxed, string, vec};
pub use alloc::{boxed, slice, string, vec};
pub use core::*;
pub mod collections {
#[allow(unused_extern_crates)]