]> git.lizzy.rs Git - rust.git/blob - library/std/src/prelude/v1.rs
Rollup merge of #96088 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / library / std / src / prelude / v1.rs
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::{bench, derive, global_allocator, test, test_case};
64
65 // Do not `doc(no_inline)` either.
66 #[unstable(
67     feature = "cfg_accessible",
68     issue = "64797",
69     reason = "`cfg_accessible` is not fully implemented"
70 )]
71 pub use core::prelude::v1::cfg_accessible;
72
73 // Do not `doc(no_inline)` either.
74 #[unstable(
75     feature = "cfg_eval",
76     issue = "82679",
77     reason = "`cfg_eval` is a recently implemented feature"
78 )]
79 pub use core::prelude::v1::cfg_eval;
80
81 // The file so far is equivalent to src/libcore/prelude/v1.rs,
82 // and below to src/liballoc/prelude.rs.
83 // Those files are duplicated rather than using glob imports
84 // because we want docs to show these re-exports as pointing to within `std`.
85
86 #[stable(feature = "rust1", since = "1.0.0")]
87 #[doc(no_inline)]
88 pub use crate::borrow::ToOwned;
89 #[stable(feature = "rust1", since = "1.0.0")]
90 #[doc(no_inline)]
91 pub use crate::boxed::Box;
92 #[stable(feature = "rust1", since = "1.0.0")]
93 #[doc(no_inline)]
94 pub use crate::string::{String, ToString};
95 #[stable(feature = "rust1", since = "1.0.0")]
96 #[doc(no_inline)]
97 pub use crate::vec::Vec;
98
99 #[cfg(bootstrap)]
100 #[unstable(feature = "cstr_internals", issue = "none")]
101 pub use alloc::ffi::CStrExt;