| 1 | //! The first version of the core prelude. |
| 2 | //! |
| 3 | //! See the [module-level documentation](super) for more. |
| 4 | |
| 5 | #![stable (feature = "core_prelude" , since = "1.4.0" )] |
| 6 | |
| 7 | // No formatting: this file is nothing but re-exports, and their order is worth preserving. |
| 8 | #![cfg_attr (rustfmt, rustfmt::skip)] |
| 9 | |
| 10 | // Re-exported core operators |
| 11 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 12 | #[doc (no_inline)] |
| 13 | pub use crate::marker::{Copy, Send, Sized, Sync, Unpin}; |
| 14 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 15 | #[doc (no_inline)] |
| 16 | pub use crate::ops::{Drop, Fn, FnMut, FnOnce}; |
| 17 | #[stable (feature = "async_closure" , since = "1.85.0" )] |
| 18 | #[doc (no_inline)] |
| 19 | pub use crate::ops::{AsyncFn, AsyncFnMut, AsyncFnOnce}; |
| 20 | |
| 21 | // Re-exported functions |
| 22 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 23 | #[doc (no_inline)] |
| 24 | pub use crate::mem::drop; |
| 25 | #[stable (feature = "size_of_prelude" , since = "1.80.0" )] |
| 26 | #[doc (no_inline)] |
| 27 | pub use crate::mem::{align_of, align_of_val, size_of, size_of_val}; |
| 28 | |
| 29 | // Re-exported types and traits |
| 30 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 31 | #[doc (no_inline)] |
| 32 | pub use crate::clone::Clone; |
| 33 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 34 | #[doc (no_inline)] |
| 35 | pub use crate::cmp::{Eq, Ord, PartialEq, PartialOrd}; |
| 36 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 37 | #[doc (no_inline)] |
| 38 | pub use crate::convert::{AsMut, AsRef, From, Into}; |
| 39 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 40 | #[doc (no_inline)] |
| 41 | pub use crate::default::Default; |
| 42 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 43 | #[doc (no_inline)] |
| 44 | pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator, Extend, IntoIterator, Iterator}; |
| 45 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 46 | #[doc (no_inline)] |
| 47 | pub use crate::option::Option::{self, None, Some}; |
| 48 | #[stable (feature = "core_prelude" , since = "1.4.0" )] |
| 49 | #[doc (no_inline)] |
| 50 | pub use crate::result::Result::{self, Err, Ok}; |
| 51 | |
| 52 | // Re-exported built-in macros |
| 53 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
| 54 | #[doc (no_inline)] |
| 55 | pub use crate::fmt::macros::Debug; |
| 56 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
| 57 | #[doc (no_inline)] |
| 58 | pub use crate::hash::macros::Hash; |
| 59 | |
| 60 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
| 61 | #[allow (deprecated)] |
| 62 | #[doc (no_inline)] |
| 63 | pub use crate::{ |
| 64 | assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args, |
| 65 | format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env, |
| 66 | stringify, trace_macros, |
| 67 | }; |
| 68 | |
| 69 | #[unstable ( |
| 70 | feature = "concat_bytes" , |
| 71 | issue = "87555" , |
| 72 | reason = "`concat_bytes` is not stable enough for use and is subject to change" |
| 73 | )] |
| 74 | #[doc (no_inline)] |
| 75 | pub use crate::concat_bytes; |
| 76 | |
| 77 | // Do not `doc(no_inline)` so that they become doc items on their own |
| 78 | // (no public module for them to be re-exported from). |
| 79 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
| 80 | pub use crate::macros::builtin::{ |
| 81 | alloc_error_handler, bench , derive , global_allocator , test , test_case , |
| 82 | }; |
| 83 | |
| 84 | #[unstable (feature = "derive_const" , issue = "none" )] |
| 85 | pub use crate::macros::builtin::derive_const ; |
| 86 | |
| 87 | #[unstable ( |
| 88 | feature = "cfg_accessible" , |
| 89 | issue = "64797" , |
| 90 | reason = "`cfg_accessible` is not fully implemented" |
| 91 | )] |
| 92 | pub use crate::macros::builtin::cfg_accessible ; |
| 93 | |
| 94 | #[unstable ( |
| 95 | feature = "cfg_eval" , |
| 96 | issue = "82679" , |
| 97 | reason = "`cfg_eval` is a recently implemented feature" |
| 98 | )] |
| 99 | pub use crate::macros::builtin::cfg_eval ; |
| 100 | |
| 101 | #[unstable ( |
| 102 | feature = "type_ascription" , |
| 103 | issue = "23416" , |
| 104 | reason = "placeholder syntax for type ascription" |
| 105 | )] |
| 106 | pub use crate::macros::builtin::type_ascribe; |
| 107 | |
| 108 | #[unstable ( |
| 109 | feature = "deref_patterns" , |
| 110 | issue = "87121" , |
| 111 | reason = "placeholder syntax for deref patterns" |
| 112 | )] |
| 113 | pub use crate::macros::builtin::deref; |
| 114 | |
| 115 | #[unstable ( |
| 116 | feature = "type_alias_impl_trait" , |
| 117 | issue = "63063" , |
| 118 | reason = "`type_alias_impl_trait` has open design concerns" |
| 119 | )] |
| 120 | #[cfg (not(bootstrap))] |
| 121 | pub use crate::macros::builtin::define_opaque; |
| 122 | |