Verified Commit 13d58c3c authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add std re-exports and prelude

parent d2b01200
#![no_std]
#![feature(alloc)]
#![feature(core_intrinsics)]
#![feature(prelude_import)]
#![feature(raw)]
#![feature(slice_concat_ext)]
/* This section was addapted from the Rust Standard Library, and is licensed accordingly
* https://github.com/rust-lang/rust/blob/master/src/libstd/lib.rs
* {
*/
// Explicitly import the prelude. The compiler uses this same unstable attribute
// to import the prelude implicitly when building crates that depend on std.
#[prelude_import]
#[allow(unused)]
use prelude::*;
// Re-export a few macros from core
pub use core::{assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne};
pub use core::{unreachable, unimplemented, write, writeln, r#try};
#[allow(unused_imports)]
#[macro_use]
extern crate alloc as alloc_crate;
// The standard macros that are not built-in to the compiler.
#[macro_use]
mod macros;
// The Rust prelude
pub mod prelude;
// Public module declarations and re-exports
pub use core::any;
pub use core::arch;
pub use core::cell;
pub use core::clone;
pub use core::cmp;
pub use core::convert;
pub use core::default;
pub use core::hash;
pub use core::intrinsics;
pub use core::iter;
pub use core::marker;
pub use core::mem;
pub use core::ops;
pub use core::ptr;
pub use core::raw;
pub use core::result;
pub use core::option;
pub use core::isize;
pub use core::i8;
pub use core::i16;
pub use core::i32;
pub use core::i64;
pub use core::i128;
pub use core::usize;
pub use core::u8;
pub use core::u16;
pub use core::u32;
pub use core::u64;
pub use alloc_crate::boxed;
pub use alloc_crate::rc;
pub use alloc_crate::borrow;
pub use alloc_crate::fmt;
pub use alloc_crate::format;
pub use core::pin;
pub use alloc_crate::slice;
pub use alloc_crate::str;
pub use alloc_crate::string;
pub use alloc_crate::vec;
pub use core::char;
pub use core::u128;
pub use core::hint;
/* } */
pub use uefi;
pub use uefi_alloc;
pub mod io;
pub mod math;
pub mod rt;
......
/* This section was addapted from the Rust Standard Library, and is licensed accordingly
* https://raw.githubusercontent.com/rust-lang/rust/master/src/libstd/prelude/v1.rs
* {
*/
// Re-exported core operators
#[doc(no_inline)]
pub use crate::marker::{Copy, Send, Sized, Sync, Unpin};
#[doc(no_inline)]
pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
// Re-exported functions
#[doc(no_inline)]
pub use crate::mem::drop;
// Re-exported types and traits
#[doc(no_inline)]
pub use crate::clone::Clone;
#[doc(no_inline)]
pub use crate::cmp::{PartialEq, PartialOrd, Eq, Ord};
#[doc(no_inline)]
pub use crate::convert::{AsRef, AsMut, Into, From};
#[doc(no_inline)]
pub use crate::default::Default;
#[doc(no_inline)]
pub use crate::iter::{Iterator, Extend, IntoIterator};
#[doc(no_inline)]
pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
#[doc(no_inline)]
pub use crate::option::Option::{self, Some, None};
#[doc(no_inline)]
pub use crate::result::Result::{self, Ok, Err};
// The file so far is equivalent to src/libcore/prelude/v1.rs,
// and below to src/liballoc/prelude.rs.
// Those files are duplicated rather than using glob imports
// because we want docs to show these re-exports as pointing to within `std`.
#[doc(no_inline)]
pub use crate::boxed::Box;
#[doc(no_inline)]
pub use crate::borrow::ToOwned;
#[doc(no_inline)]
pub use crate::slice::SliceConcatExt;
#[doc(no_inline)]
pub use crate::string::{String, ToString};
#[doc(no_inline)]
pub use crate::vec::Vec;
/* } */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment