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 | // Re-exported core operators |
8 | #[stable (feature = "rust1" , since = "1.0.0" )] |
9 | #[doc (no_inline)] |
10 | pub use crate::marker::{Send, Sized, Sync, Unpin}; |
11 | #[stable (feature = "rust1" , since = "1.0.0" )] |
12 | #[doc (no_inline)] |
13 | pub use crate::ops::{Drop, Fn, FnMut, FnOnce}; |
14 | |
15 | // Re-exported functions |
16 | #[stable (feature = "rust1" , since = "1.0.0" )] |
17 | #[doc (no_inline)] |
18 | pub use crate::mem::drop; |
19 | |
20 | // Re-exported types and traits |
21 | #[stable (feature = "rust1" , since = "1.0.0" )] |
22 | #[doc (no_inline)] |
23 | pub use crate::convert::{AsMut, AsRef, From, Into}; |
24 | #[stable (feature = "rust1" , since = "1.0.0" )] |
25 | #[doc (no_inline)] |
26 | pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator}; |
27 | #[stable (feature = "rust1" , since = "1.0.0" )] |
28 | #[doc (no_inline)] |
29 | pub use crate::iter::{Extend, IntoIterator, Iterator}; |
30 | #[stable (feature = "rust1" , since = "1.0.0" )] |
31 | #[doc (no_inline)] |
32 | pub use crate::option::Option::{self, None, Some}; |
33 | #[stable (feature = "rust1" , since = "1.0.0" )] |
34 | #[doc (no_inline)] |
35 | pub use crate::result::Result::{self, Err, Ok}; |
36 | |
37 | // Re-exported built-in macros |
38 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
39 | #[allow (deprecated)] |
40 | #[doc (no_inline)] |
41 | pub use core::prelude::v1::{ |
42 | assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args, |
43 | format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env, |
44 | stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, |
45 | }; |
46 | |
47 | #[unstable ( |
48 | feature = "concat_bytes" , |
49 | issue = "87555" , |
50 | reason = "`concat_bytes` is not stable enough for use and is subject to change" |
51 | )] |
52 | #[doc (no_inline)] |
53 | pub use core::prelude::v1::concat_bytes; |
54 | |
55 | // Do not `doc(inline)` these `doc(hidden)` items. |
56 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
57 | #[allow (deprecated)] |
58 | pub use core::prelude::v1::{RustcDecodable, RustcEncodable}; |
59 | |
60 | // Do not `doc(no_inline)` so that they become doc items on their own |
61 | // (no public module for them to be re-exported from). |
62 | #[stable (feature = "builtin_macro_prelude" , since = "1.38.0" )] |
63 | pub use core::prelude::v1::{ |
64 | alloc_error_handler, bench , derive , global_allocator , test , test_case , |
65 | }; |
66 | |
67 | #[unstable (feature = "derive_const" , issue = "none" )] |
68 | pub use core::prelude::v1::derive_const ; |
69 | |
70 | // Do not `doc(no_inline)` either. |
71 | #[unstable ( |
72 | feature = "cfg_accessible" , |
73 | issue = "64797" , |
74 | reason = "`cfg_accessible` is not fully implemented" |
75 | )] |
76 | pub use core::prelude::v1::cfg_accessible ; |
77 | |
78 | // Do not `doc(no_inline)` either. |
79 | #[unstable ( |
80 | feature = "cfg_eval" , |
81 | issue = "82679" , |
82 | reason = "`cfg_eval` is a recently implemented feature" |
83 | )] |
84 | pub use core::prelude::v1::cfg_eval ; |
85 | |
86 | // Do not `doc(no_inline)` either. |
87 | #[unstable ( |
88 | feature = "type_ascription" , |
89 | issue = "23416" , |
90 | reason = "placeholder syntax for type ascription" |
91 | )] |
92 | pub use core::prelude::v1::type_ascribe; |
93 | |
94 | // The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated |
95 | // rather than glob imported because we want docs to show these re-exports as |
96 | // pointing to within `std`. |
97 | // Below are the items from the alloc crate. |
98 | |
99 | #[stable (feature = "rust1" , since = "1.0.0" )] |
100 | #[doc (no_inline)] |
101 | pub use crate::borrow::ToOwned; |
102 | #[stable (feature = "rust1" , since = "1.0.0" )] |
103 | #[doc (no_inline)] |
104 | pub use crate::boxed::Box; |
105 | #[stable (feature = "rust1" , since = "1.0.0" )] |
106 | #[doc (no_inline)] |
107 | pub use crate::string::{String, ToString}; |
108 | #[stable (feature = "rust1" , since = "1.0.0" )] |
109 | #[doc (no_inline)] |
110 | pub use crate::vec::Vec; |
111 | |