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