| 1 | //! The first version of the prelude of The Rust Standard Library. |
| 2 | //! |
| 3 | //! See the [module-level documentation](super) for more. |
| 4 | |
| 5 | #![stable (feature = "rust1" , since = "1.0.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 = "rust1" , since = "1.0.0" )] |
| 12 | #[doc (no_inline)] |
| 13 | pub use crate::marker::{Send, Sized, Sync, Unpin}; |
| 14 | #[stable (feature = "rust1" , since = "1.0.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 = "rust1" , since = "1.0.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 = "rust1" , since = "1.0.0" )] |
| 31 | #[doc (no_inline)] |
| 32 | pub use crate::convert::{AsMut, AsRef, From, Into}; |
| 33 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 34 | #[doc (no_inline)] |
| 35 | pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator}; |
| 36 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 37 | #[doc (no_inline)] |
| 38 | pub use crate::iter::{Extend, IntoIterator, Iterator}; |
| 39 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 40 | #[doc (no_inline)] |
| 41 | pub use crate::option::Option::{self, None, Some}; |
| 42 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 43 | #[doc (no_inline)] |
| 44 | pub use crate::result::Result::{self, Err, Ok}; |
| 45 | |
| 46 | // Re-exported built-in macros |
| 47 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
| 48 | #[allow (deprecated)] |
| 49 | #[doc (no_inline)] |
| 50 | pub use core::prelude::v1::{ |
| 51 | assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args, |
| 52 | format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env, |
| 53 | stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, |
| 54 | }; |
| 55 | |
| 56 | #[unstable ( |
| 57 | feature = "concat_bytes" , |
| 58 | issue = "87555" , |
| 59 | reason = "`concat_bytes` is not stable enough for use and is subject to change" |
| 60 | )] |
| 61 | #[doc (no_inline)] |
| 62 | pub use core::prelude::v1::concat_bytes; |
| 63 | |
| 64 | // Do not `doc(no_inline)` so that they become doc items on their own |
| 65 | // (no public module for them to be re-exported from). |
| 66 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
| 67 | pub use core::prelude::v1::{ |
| 68 | alloc_error_handler, bench , derive , global_allocator , test , test_case , |
| 69 | }; |
| 70 | |
| 71 | #[unstable (feature = "derive_const" , issue = "none" )] |
| 72 | pub use core::prelude::v1::derive_const ; |
| 73 | |
| 74 | // Do not `doc(no_inline)` either. |
| 75 | #[unstable ( |
| 76 | feature = "cfg_accessible" , |
| 77 | issue = "64797" , |
| 78 | reason = "`cfg_accessible` is not fully implemented" |
| 79 | )] |
| 80 | pub use core::prelude::v1::cfg_accessible ; |
| 81 | |
| 82 | // Do not `doc(no_inline)` either. |
| 83 | #[unstable ( |
| 84 | feature = "cfg_eval" , |
| 85 | issue = "82679" , |
| 86 | reason = "`cfg_eval` is a recently implemented feature" |
| 87 | )] |
| 88 | pub use core::prelude::v1::cfg_eval ; |
| 89 | |
| 90 | // Do not `doc(no_inline)` either. |
| 91 | #[unstable ( |
| 92 | feature = "type_ascription" , |
| 93 | issue = "23416" , |
| 94 | reason = "placeholder syntax for type ascription" |
| 95 | )] |
| 96 | pub use core::prelude::v1::type_ascribe; |
| 97 | |
| 98 | // Do not `doc(no_inline)` either. |
| 99 | #[unstable ( |
| 100 | feature = "deref_patterns" , |
| 101 | issue = "87121" , |
| 102 | reason = "placeholder syntax for deref patterns" |
| 103 | )] |
| 104 | pub use core::prelude::v1::deref; |
| 105 | |
| 106 | // Do not `doc(no_inline)` either. |
| 107 | #[unstable ( |
| 108 | feature = "type_alias_impl_trait" , |
| 109 | issue = "63063" , |
| 110 | reason = "`type_alias_impl_trait` has open design concerns" |
| 111 | )] |
| 112 | pub use core::prelude::v1::define_opaque; |
| 113 | |
| 114 | // The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated |
| 115 | // rather than glob imported because we want docs to show these re-exports as |
| 116 | // pointing to within `std`. |
| 117 | // Below are the items from the alloc crate. |
| 118 | |
| 119 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 120 | #[doc (no_inline)] |
| 121 | pub use crate::borrow::ToOwned; |
| 122 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 123 | #[doc (no_inline)] |
| 124 | pub use crate::boxed::Box; |
| 125 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 126 | #[doc (no_inline)] |
| 127 | pub use crate::string::{String, ToString}; |
| 128 | #[stable (feature = "rust1" , since = "1.0.0" )] |
| 129 | #[doc (no_inline)] |
| 130 | pub use crate::vec::Vec; |
| 131 | |