Fix no_std build with "alloc" feature in Rust 1.29 and newer

This commit is contained in:
Rafał Harabień 2019-07-17 19:13:15 +02:00
parent 0792b167ae
commit 240fd01a9d
4 changed files with 8 additions and 4 deletions

View File

@ -18,7 +18,11 @@ matrix:
# See: https://github.com/BurntSushi/byteorder/pull/150 # See: https://github.com/BurntSushi/byteorder/pull/150
- cargo update && cargo update -p byteorder --precise 1.2.7 - cargo update && cargo update -p byteorder --precise 1.2.7
- cargo build --no-default-features --features core_io - cargo build --no-default-features --features core_io
- cargo build --no-default-features --features core_io,alloc,core_io/collections - cargo build --no-default-features --features core_io,alloc
- rust: nightly-2019-07-01
script:
- cargo build --no-default-features --features core_io
- cargo build --no-default-features --features core_io,alloc
allow_failures: allow_failures:
- rust: nightly - rust: nightly

View File

@ -1,5 +1,5 @@
#[cfg(all(not(feature = "std"), feature = "alloc"))] #[cfg(all(not(feature = "std"), feature = "alloc"))]
use alloc::Vec; use alloc::vec::Vec;
use core::{char, cmp, num, str}; use core::{char, cmp, num, str};
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
use core::{iter, slice}; use core::{iter, slice};

View File

@ -1,5 +1,5 @@
#[cfg(all(not(feature = "std"), feature = "alloc"))] #[cfg(all(not(feature = "std"), feature = "alloc"))]
use alloc::{String, Vec}; use alloc::{string::String, vec::Vec};
use core::char; use core::char;
use core::iter::FromIterator; use core::iter::FromIterator;
use core::{fmt, str}; use core::{fmt, str};

View File

@ -1,5 +1,5 @@
#[cfg(all(not(feature = "std"), feature = "alloc"))] #[cfg(all(not(feature = "std"), feature = "alloc"))]
use alloc::String; use alloc::string::String;
use core::cell::{Cell, RefCell}; use core::cell::{Cell, RefCell};
use core::char; use core::char;
use core::cmp; use core::cmp;