]> git.lizzy.rs Git - rust.git/blob - library/std/src/prelude/v1.rs
Auto merge of #105018 - zertosh:path_buf_deref_mut, r=dtolnay
[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 #[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};
67
68 #[unstable(feature = "derive_const", issue = "none")]
69 #[cfg(not(bootstrap))]
70 pub use core::prelude::v1::derive_const;
71
72 // Do not `doc(no_inline)` either.
73 #[unstable(
74     feature = "cfg_accessible",
75     issue = "64797",
76     reason = "`cfg_accessible` is not fully implemented"
77 )]
78 pub use core::prelude::v1::cfg_accessible;
79
80 // Do not `doc(no_inline)` either.
81 #[unstable(
82     feature = "cfg_eval",
83     issue = "82679",
84     reason = "`cfg_eval` is a recently implemented feature"
85 )]
86 pub use core::prelude::v1::cfg_eval;
87
88 // Do not `doc(no_inline)` either.
89 #[unstable(
90     feature = "type_ascription",
91     issue = "23416",
92     reason = "placeholder syntax for type ascription"
93 )]
94 #[cfg(not(bootstrap))]
95 pub use core::prelude::v1::type_ascribe;
96
97 // The file so far is equivalent to src/libcore/prelude/v1.rs,
98 // and below to src/liballoc/prelude.rs.
99 // Those files are duplicated rather than using glob imports
100 // because we want docs to show these re-exports as pointing to within `std`.
101
102 #[stable(feature = "rust1", since = "1.0.0")]
103 #[doc(no_inline)]
104 pub use crate::borrow::ToOwned;
105 #[stable(feature = "rust1", since = "1.0.0")]
106 #[doc(no_inline)]
107 pub use crate::boxed::Box;
108 #[stable(feature = "rust1", since = "1.0.0")]
109 #[doc(no_inline)]
110 pub use crate::string::{String, ToString};
111 #[stable(feature = "rust1", since = "1.0.0")]
112 #[doc(no_inline)]
113 pub use crate::vec::Vec;