Alloc/Collections got merged
This commit is contained in:
parent
fc76269575
commit
3bd0da553e
4
build.rs
4
build.rs
@ -55,6 +55,10 @@ fn main() {
|
|||||||
println!("cargo:rustc-cfg=std_unicode");
|
println!("cargo:rustc-cfg=std_unicode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ver.commit_date.as_ref().map_or(false,|d| &**d>"2017-06-15") {
|
||||||
|
println!("cargo:rustc-cfg=collections_in_alloc");
|
||||||
|
}
|
||||||
|
|
||||||
let mut dest_path=PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
let mut dest_path=PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||||
dest_path.push("io.rs");
|
dest_path.push("io.rs");
|
||||||
let mut f=File::create(&dest_path).unwrap();
|
let mut f=File::create(&dest_path).unwrap();
|
||||||
|
@ -969,7 +969,7 @@ diff --git a/mod.rs b/mod.rs
|
|||||||
index d403bf6..50bbc9d 100644
|
index d403bf6..50bbc9d 100644
|
||||||
--- a/mod.rs
|
--- a/mod.rs
|
||||||
+++ b/mod.rs
|
+++ b/mod.rs
|
||||||
@@ -268,50 +268,33 @@
|
@@ -268,50 +268,35 @@
|
||||||
//! [`Result`]: ../result/enum.Result.html
|
//! [`Result`]: ../result/enum.Result.html
|
||||||
//! [`.unwrap()`]: ../result/enum.Result.html#method.unwrap
|
//! [`.unwrap()`]: ../result/enum.Result.html#method.unwrap
|
||||||
|
|
||||||
@ -1012,6 +1012,8 @@ index d403bf6..50bbc9d 100644
|
|||||||
-#[unstable(feature = "libstd_io_internals", issue = "42788")]
|
-#[unstable(feature = "libstd_io_internals", issue = "42788")]
|
||||||
-#[doc(no_inline, hidden)]
|
-#[doc(no_inline, hidden)]
|
||||||
-pub use self::stdio::{set_panic, set_print};
|
-pub use self::stdio::{set_panic, set_print};
|
||||||
|
+#[cfg(feature="collections")] use collections::string::String;
|
||||||
|
+#[cfg(feature="collections")] use collections::vec::Vec;
|
||||||
|
|
||||||
pub mod prelude;
|
pub mod prelude;
|
||||||
-mod buffered;
|
-mod buffered;
|
||||||
|
13
src/lib.rs
13
src/lib.rs
@ -6,9 +6,16 @@
|
|||||||
#![feature(question_mark,const_fn,collections,alloc,unicode,copy_from_slice,str_char,try_from,str_internals,slice_internals)]
|
#![feature(question_mark,const_fn,collections,alloc,unicode,copy_from_slice,str_char,try_from,str_internals,slice_internals)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
#[cfg_attr(feature="collections",macro_use)]
|
#[cfg_attr(all(feature="collections", not(collections_in_alloc)), macro_use)]
|
||||||
#[cfg(feature="collections")] extern crate collections;
|
#[cfg(all(feature="collections", not(collections_in_alloc)))] extern crate collections;
|
||||||
#[cfg(feature="alloc")] extern crate alloc;
|
|
||||||
|
#[cfg_attr(all(feature="collections", collections_in_alloc), macro_use)]
|
||||||
|
#[cfg(any(all(feature="collections", collections_in_alloc), feature="alloc"))]
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
#[cfg(all(feature="collections", collections_in_alloc))]
|
||||||
|
use alloc as collections;
|
||||||
|
|
||||||
#[cfg(rustc_unicode)]
|
#[cfg(rustc_unicode)]
|
||||||
extern crate rustc_unicode;
|
extern crate rustc_unicode;
|
||||||
#[cfg(std_unicode)]
|
#[cfg(std_unicode)]
|
||||||
|
Loading…
Reference in New Issue
Block a user