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)]
45#[cfg(not(feature = "ferrocene_certified"))]
46pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator, Extend, IntoIterator, Iterator};
47#[stable(feature = "core_prelude", since = "1.4.0")]
48#[doc(no_inline)]
49pub use crate::option::Option::{self, None, Some};
50#[stable(feature = "core_prelude", since = "1.4.0")]
51#[doc(no_inline)]
52pub use crate::result::Result::{self, Err, Ok};
53
54// Ferrocene addition: imports for certified subset
55#[stable(feature = "core_prelude", since = "1.4.0")]
56#[doc(no_inline)]
57#[cfg(feature = "ferrocene_certified")]
58#[rustfmt::skip]
59pub use crate::iter::{ExactSizeIterator, Extend, IntoIterator, Iterator};
60
61// Re-exported built-in macros
62#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
63#[doc(no_inline)]
64#[cfg(not(feature = "ferrocene_certified"))]
65pub use crate::fmt::macros::Debug;
66#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
67#[doc(no_inline)]
68#[cfg(not(feature = "ferrocene_certified"))]
69pub use crate::hash::macros::Hash;
70
71#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
72#[doc(no_inline)]
73pub use crate::{
74    assert, cfg, column, compile_error, concat, env, file, format_args,
75    format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
76    stringify, trace_macros,
77};
78
79#[unstable(
80    feature = "concat_bytes",
81    issue = "87555",
82    reason = "`concat_bytes` is not stable enough for use and is subject to change"
83)]
84#[doc(no_inline)]
85#[cfg(not(feature = "ferrocene_certified"))]
86pub use crate::concat_bytes;
87
88// Do not `doc(no_inline)` so that they become doc items on their own
89// (no public module for them to be re-exported from).
90#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
91pub use crate::macros::builtin::{
92    alloc_error_handler, bench, derive, global_allocator, test, test_case,
93};
94
95#[unstable(feature = "derive_const", issue = "118304")]
96pub use crate::macros::builtin::derive_const;
97
98#[unstable(
99    feature = "cfg_accessible",
100    issue = "64797",
101    reason = "`cfg_accessible` is not fully implemented"
102)]
103pub use crate::macros::builtin::cfg_accessible;
104
105#[unstable(
106    feature = "cfg_eval",
107    issue = "82679",
108    reason = "`cfg_eval` is a recently implemented feature"
109)]
110pub use crate::macros::builtin::cfg_eval;
111
112#[unstable(
113    feature = "type_ascription",
114    issue = "23416",
115    reason = "placeholder syntax for type ascription"
116)]
117pub use crate::macros::builtin::type_ascribe;
118
119#[unstable(
120    feature = "deref_patterns",
121    issue = "87121",
122    reason = "placeholder syntax for deref patterns"
123)]
124pub use crate::macros::builtin::deref;
125
126#[unstable(
127    feature = "type_alias_impl_trait",
128    issue = "63063",
129    reason = "`type_alias_impl_trait` has open design concerns"
130)]
131pub use crate::macros::builtin::define_opaque;