xref: /relibc/core_io/src/lib.rs (revision e78ca2bc0356faf106357c3b6d8a0ff3f37badac)
1 //! <p id="core_io-show-docblock"></p>
2 //! This is just a listing of the functionality available in this crate. See
3 //! the [std documentation](https://doc.rust-lang.org/nightly/std/io/index.html)
4 //! for a full description of the functionality.
5 #![allow(stable_features,unused_features)]
6 #![feature(question_mark,const_fn,collections,alloc,unicode,copy_from_slice,str_char,try_from,str_internals)]
7 #![no_std]
8 
9 #[cfg_attr(feature="collections",macro_use)]
10 #[cfg(feature="collections")] extern crate collections;
11 #[cfg(feature="alloc")] extern crate alloc;
12 #[cfg(rustc_unicode)]
13 extern crate rustc_unicode;
14 #[cfg(std_unicode)]
15 extern crate std_unicode;
16 
17 #[cfg(not(feature="collections"))]
18 pub type ErrorString = &'static str;
19 
20 // Provide Box::new wrapper
21 #[cfg(not(feature="alloc"))]
22 struct FakeBox<T>(core::marker::PhantomData<T>);
23 #[cfg(not(feature="alloc"))]
24 impl<T> FakeBox<T> {
25 	fn new(val: T) -> T {
26 		val
27 	}
28 }
29 
30 // Needed for older compilers, to ignore vec!/format! macros in tests
31 #[cfg(not(feature="collections"))]
32 #[allow(unused)]
33 macro_rules! vec (
34 	( $ elem : expr ; $ n : expr ) => { () };
35 	( $ ( $ x : expr ) , * ) => { () };
36 	( $ ( $ x : expr , ) * ) => { () };
37 );
38 #[cfg(not(feature="collections"))]
39 #[allow(unused)]
40 macro_rules! format {
41 	( $ ( $ arg : tt ) * ) => { () };
42 }
43 
44 include!(concat!(env!("OUT_DIR"), "/io.rs"));
45 pub use io::*;
46