Fix build with use_alloc+use_std.
This commit is contained in:
parent
b1e24a9826
commit
f32ddb6286
@ -13,6 +13,8 @@ matrix:
|
||||
env: FEATURES='use_collections'
|
||||
- rust: nightly
|
||||
env: FEATURES='use_alloc use_collections'
|
||||
- rust: nightly
|
||||
env: FEATURES='use_std use_alloc use_collections'
|
||||
script:
|
||||
- cargo build --features "$FEATURES"
|
||||
notifications:
|
||||
|
@ -1,12 +1,12 @@
|
||||
#![no_std]
|
||||
#![cfg_attr(feature = "use_alloc", feature(alloc))]
|
||||
#![cfg_attr(feature = "use_collections", feature(collections))]
|
||||
#![cfg_attr(all(feature = "use_alloc", not(feature = "use_std")), feature(alloc))]
|
||||
#![cfg_attr(all(feature = "use_collections", not(feature = "use_std")), feature(collections))]
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
extern crate std;
|
||||
#[cfg(feature = "use_alloc")]
|
||||
#[cfg(all(feature = "use_alloc", not(feature = "use_std")))]
|
||||
extern crate alloc;
|
||||
#[cfg(feature = "use_collections")]
|
||||
#[cfg(all(feature = "use_collections", not(feature = "use_std")))]
|
||||
extern crate collections;
|
||||
|
||||
mod object;
|
||||
|
@ -3,11 +3,11 @@ use core::fmt;
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
use std::boxed::Box;
|
||||
#[cfg(feature = "use_alloc")]
|
||||
#[cfg(all(feature = "use_alloc", not(feature = "use_std")))]
|
||||
use alloc::boxed::Box;
|
||||
#[cfg(feature = "use_std")]
|
||||
use std::vec::Vec;
|
||||
#[cfg(all(feature = "use_alloc", feature = "use_collections"))]
|
||||
#[cfg(all(feature = "use_alloc", feature = "use_collections", not(feature = "use_std")))]
|
||||
use collections::vec::Vec;
|
||||
|
||||
/// A managed object.
|
||||
|
@ -3,7 +3,7 @@ use core::fmt;
|
||||
|
||||
#[cfg(feature = "use_std")]
|
||||
use std::vec::Vec;
|
||||
#[cfg(feature = "use_collections")]
|
||||
#[cfg(all(feature = "use_collections", not(feature = "use_std")))]
|
||||
use collections::vec::Vec;
|
||||
|
||||
/// A managed slice.
|
||||
|
Loading…
Reference in New Issue
Block a user