core/prelude/
v1.rs

1//! The first version of the core prelude.
2//!
3//! See the [module-level documentation](super) for more.
4
5#![stable(feature = "core_prelude", since = "1.4.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 = "core_prelude", since = "1.4.0")]
12#[doc(no_inline)]
13pub use crate::marker::{Copy, Send, Sized, Sync, Unpin};
14#[stable(feature = "core_prelude", since = "1.4.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)]
19#[cfg(not(feature = "ferrocene_certified"))]
20pub use crate::ops::{AsyncFn, AsyncFnMut, AsyncFnOnce};
21
22// Re-exported functions
23#[stable(feature = "core_prelude", since = "1.4.0")]
24#[doc(no_inline)]
25pub use crate::mem::drop;
26#[stable(feature = "size_of_prelude", since = "1.80.0")]
27#[doc(no_inline)]
28pub use crate::mem::{align_of, align_of_val, size_of, size_of_val};
29
30// Re-exported types and traits
31#[stable(feature = "core_prelude", since = "1.4.0")]
32#[doc(no_inline)]
33pub use crate::clone::Clone;
34#[stable(feature = "core_prelude", since = "1.4.0")]
35#[doc(no_inline)]
36pub use crate::cmp::{Eq, Ord, PartialEq, PartialOrd};
37#[stable(feature = "core_prelude", since = "1.4.0")]
38#[doc(no_inline)]
39pub use crate::convert::{AsMut, AsRef, From, Into};
40#[stable(feature = "core_prelude", since = "1.4.0")]
41#[doc(no_inline)]
42pub use crate::default::Default;
43#[stable(feature = "core_prelude", since = "1.4.0")]
44#[doc(no_inline)]
45pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator, Extend, IntoIterator, Iterator};
46#[stable(feature = "core_prelude", since = "1.4.0")]
47#[doc(no_inline)]
48pub use crate::option::Option::{self, None, Some};
49#[stable(feature = "core_prelude", since = "1.4.0")]
50#[doc(no_inline)]
51pub use crate::result::Result::{self, Err, Ok};
52
53// Re-exported built-in macros
54#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
55#[doc(no_inline)]
56#[cfg(not(feature = "ferrocene_certified"))]
57pub use crate::fmt::macros::Debug;
58#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
59#[doc(no_inline)]
60#[cfg(not(feature = "ferrocene_certified"))]
61pub use crate::hash::macros::Hash;
62
63#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
64#[doc(no_inline)]
65pub use crate::{
66    assert, cfg, column, compile_error, concat, env, file, format_args,
67    format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
68    stringify, trace_macros,
69};
70
71#[unstable(
72    feature = "concat_bytes",
73    issue = "87555",
74    reason = "`concat_bytes` is not stable enough for use and is subject to change"
75)]
76#[doc(no_inline)]
77#[cfg(not(feature = "ferrocene_certified"))]
78pub use crate::concat_bytes;
79
80// Do not `doc(no_inline)` so that they become doc items on their own
81// (no public module for them to be re-exported from).
82#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
83pub use crate::macros::builtin::{
84    alloc_error_handler, bench, derive, global_allocator, test, test_case,
85};
86
87#[unstable(feature = "derive_const", issue = "118304")]
88pub use crate::macros::builtin::derive_const;
89
90#[unstable(
91    feature = "cfg_accessible",
92    issue = "64797",
93    reason = "`cfg_accessible` is not fully implemented"
94)]
95pub use crate::macros::builtin::cfg_accessible;
96
97#[unstable(
98    feature = "cfg_eval",
99    issue = "82679",
100    reason = "`cfg_eval` is a recently implemented feature"
101)]
102pub use crate::macros::builtin::cfg_eval;
103
104#[unstable(
105    feature = "type_ascription",
106    issue = "23416",
107    reason = "placeholder syntax for type ascription"
108)]
109pub use crate::macros::builtin::type_ascribe;
110
111#[unstable(
112    feature = "deref_patterns",
113    issue = "87121",
114    reason = "placeholder syntax for deref patterns"
115)]
116pub use crate::macros::builtin::deref;
117
118#[unstable(
119    feature = "type_alias_impl_trait",
120    issue = "63063",
121    reason = "`type_alias_impl_trait` has open design concerns"
122)]
123pub use crate::macros::builtin::define_opaque;