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