]>
Commit | Line | Data |
---|---|---|
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 | 12 | pub use crate::marker::{Copy, Send, Sized, Sync, Unpin}; |
92a42be0 | 13 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 14 | #[doc(no_inline)] |
48663c56 | 15 | pub 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 | 20 | pub 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 | 25 | pub use crate::clone::Clone; |
92a42be0 | 26 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 27 | #[doc(no_inline)] |
60c5eb7d | 28 | pub use crate::cmp::{Eq, Ord, PartialEq, PartialOrd}; |
92a42be0 | 29 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 30 | #[doc(no_inline)] |
60c5eb7d | 31 | pub use crate::convert::{AsMut, AsRef, From, Into}; |
92a42be0 | 32 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 33 | #[doc(no_inline)] |
48663c56 | 34 | pub use crate::default::Default; |
92a42be0 | 35 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 36 | #[doc(no_inline)] |
60c5eb7d | 37 | pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator}; |
92a42be0 | 38 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 39 | #[doc(no_inline)] |
60c5eb7d | 40 | pub use crate::iter::{Extend, IntoIterator, Iterator}; |
92a42be0 | 41 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 42 | #[doc(no_inline)] |
60c5eb7d | 43 | pub use crate::option::Option::{self, None, Some}; |
92a42be0 | 44 | #[stable(feature = "core_prelude", since = "1.4.0")] |
c30ab7b3 | 45 | #[doc(no_inline)] |
60c5eb7d | 46 | pub 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)] | |
51 | pub use crate::fmt::macros::Debug; | |
416331ca XL |
52 | #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] |
53 | #[doc(no_inline)] | |
54 | pub 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)] |
59 | pub 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)] | |
68 | pub use crate::macros::builtin::{ | |
60c5eb7d | 69 | bench, global_allocator, test, test_case, RustcDecodable, RustcEncodable, |
416331ca | 70 | }; |
ba9703b0 | 71 | |
ba9703b0 XL |
72 | #[unstable( |
73 | feature = "cfg_accessible", | |
74 | issue = "64797", | |
75 | reason = "`cfg_accessible` is not fully implemented" | |
76 | )] | |
77 | #[doc(no_inline)] | |
78 | pub use crate::macros::builtin::cfg_accessible; |