1 //! The first version of the prelude of The Rust Standard Library.
3 //! See the [module-level documentation](super) for more.
5 #![stable(feature = "rust1", since = "1.0.0")]
7 // Re-exported core operators
8 #[stable(feature = "rust1", since = "1.0.0")]
10 pub use crate::marker::{Send, Sized, Sync, Unpin};
11 #[stable(feature = "rust1", since = "1.0.0")]
13 pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
15 // Re-exported functions
16 #[stable(feature = "rust1", since = "1.0.0")]
18 pub use crate::mem::drop;
20 // Re-exported types and traits
21 #[stable(feature = "rust1", since = "1.0.0")]
23 pub use crate::convert::{AsMut, AsRef, From, Into};
24 #[stable(feature = "rust1", since = "1.0.0")]
26 pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
27 #[stable(feature = "rust1", since = "1.0.0")]
29 pub use crate::iter::{Extend, IntoIterator, Iterator};
30 #[stable(feature = "rust1", since = "1.0.0")]
32 pub use crate::option::Option::{self, None, Some};
33 #[stable(feature = "rust1", since = "1.0.0")]
35 pub use crate::result::Result::{self, Err, Ok};
37 // Re-exported built-in macros
38 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
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,
48 feature = "concat_bytes",
50 reason = "`concat_bytes` is not stable enough for use and is subject to change"
53 pub use core::prelude::v1::concat_bytes;
55 // Do not `doc(inline)` these `doc(hidden)` items.
56 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
58 pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
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 #[cfg(not(bootstrap))]
63 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
64 pub use core::prelude::v1::alloc_error_handler;
65 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
66 pub use core::prelude::v1::{bench, derive, global_allocator, test, test_case};
68 #[unstable(feature = "derive_const", issue = "none")]
69 #[cfg(not(bootstrap))]
70 pub use core::prelude::v1::derive_const;
72 // Do not `doc(no_inline)` either.
74 feature = "cfg_accessible",
76 reason = "`cfg_accessible` is not fully implemented"
78 pub use core::prelude::v1::cfg_accessible;
80 // Do not `doc(no_inline)` either.
84 reason = "`cfg_eval` is a recently implemented feature"
86 pub use core::prelude::v1::cfg_eval;
88 // Do not `doc(no_inline)` either.
90 feature = "type_ascription",
92 reason = "placeholder syntax for type ascription"
94 pub use core::prelude::v1::type_ascribe;
96 // The file so far is equivalent to src/libcore/prelude/v1.rs,
97 // and below to src/liballoc/prelude.rs.
98 // Those files are duplicated rather than using glob imports
99 // because we want docs to show these re-exports as pointing to within `std`.
101 #[stable(feature = "rust1", since = "1.0.0")]
103 pub use crate::borrow::ToOwned;
104 #[stable(feature = "rust1", since = "1.0.0")]
106 pub use crate::boxed::Box;
107 #[stable(feature = "rust1", since = "1.0.0")]
109 pub use crate::string::{String, ToString};
110 #[stable(feature = "rust1", since = "1.0.0")]
112 pub use crate::vec::Vec;