]> git.proxmox.com Git - rustc.git/blame - src/libcore/prelude/v1.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / libcore / prelude / v1.rs
CommitLineData
e9174d1e
SL
1//! The core prelude
2//!
3//! This module is intended for users of libcore which do not link to libstd as
4//! well. This module is imported by default when `#![no_std]` is used in the
5//! same manner as the standard library's prelude.
6
7#![stable(feature = "core_prelude", since = "1.4.0")]
8
2c00a5a8 9// Re-exported core operators
92a42be0 10#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 11#[doc(no_inline)]
48663c56 12pub use crate::marker::{Copy, Send, Sized, Sync, Unpin};
92a42be0 13#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 14#[doc(no_inline)]
48663c56 15pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
e9174d1e 16
2c00a5a8 17// Re-exported functions
92a42be0 18#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 19#[doc(no_inline)]
48663c56 20pub use crate::mem::drop;
e9174d1e 21
2c00a5a8 22// Re-exported types and traits
92a42be0 23#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 24#[doc(no_inline)]
48663c56 25pub use crate::clone::Clone;
92a42be0 26#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 27#[doc(no_inline)]
60c5eb7d 28pub use crate::cmp::{Eq, Ord, PartialEq, PartialOrd};
92a42be0 29#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 30#[doc(no_inline)]
60c5eb7d 31pub use crate::convert::{AsMut, AsRef, From, Into};
92a42be0 32#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 33#[doc(no_inline)]
48663c56 34pub use crate::default::Default;
92a42be0 35#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 36#[doc(no_inline)]
60c5eb7d 37pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
92a42be0 38#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 39#[doc(no_inline)]
60c5eb7d 40pub use crate::iter::{Extend, IntoIterator, Iterator};
92a42be0 41#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 42#[doc(no_inline)]
60c5eb7d 43pub use crate::option::Option::{self, None, Some};
92a42be0 44#[stable(feature = "core_prelude", since = "1.4.0")]
c30ab7b3 45#[doc(no_inline)]
60c5eb7d 46pub use crate::result::Result::{self, Err, Ok};
416331ca
XL
47
48// Re-exported built-in macros
416331ca
XL
49#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
50#[doc(no_inline)]
51pub use crate::fmt::macros::Debug;
416331ca
XL
52#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
53#[doc(no_inline)]
54pub use crate::hash::macros::Hash;
55
416331ca 56#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
ba9703b0 57#[allow(deprecated)]
416331ca
XL
58#[doc(no_inline)]
59pub use crate::{
60c5eb7d 60 asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
ba9703b0
XL
61 format_args_nl, global_asm, include, include_bytes, include_str, line, llvm_asm, log_syntax,
62 module_path, option_env, stringify, trace_macros,
416331ca
XL
63};
64
416331ca
XL
65#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
66#[allow(deprecated)]
67#[doc(no_inline)]
68pub use crate::macros::builtin::{
60c5eb7d 69 bench, global_allocator, test, test_case, RustcDecodable, RustcEncodable,
416331ca 70};
ba9703b0
XL
71
72#[cfg(not(bootstrap))]
73#[unstable(
74 feature = "cfg_accessible",
75 issue = "64797",
76 reason = "`cfg_accessible` is not fully implemented"
77)]
78#[doc(no_inline)]
79pub use crate::macros::builtin::cfg_accessible;