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_subset"))]
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)]
56pub use crate::fmt::macros::Debug;
57#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
58#[doc(no_inline)]
59pub use crate::hash::macros::Hash;
60
61#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
62#[doc(no_inline)]
63pub use crate::{
64    assert, cfg, column, compile_error, concat, env, file, format_args,
65    format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
66    stringify, trace_macros,
67};
68
69#[unstable(
70    feature = "concat_bytes",
71    issue = "87555",
72    reason = "`concat_bytes` is not stable enough for use and is subject to change"
73)]
74#[doc(no_inline)]
75#[cfg(not(feature = "ferrocene_subset"))]
76pub use crate::concat_bytes;
77
78// Do not `doc(no_inline)` so that they become doc items on their own
79// (no public module for them to be re-exported from).
80#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
81pub use crate::macros::builtin::{
82    alloc_error_handler, bench, derive, global_allocator, test, test_case,
83};
84
85#[unstable(feature = "derive_const", issue = "118304")]
86pub use crate::macros::builtin::derive_const;
87
88#[unstable(
89    feature = "cfg_accessible",
90    issue = "64797",
91    reason = "`cfg_accessible` is not fully implemented"
92)]
93pub use crate::macros::builtin::cfg_accessible;
94
95#[unstable(
96    feature = "cfg_eval",
97    issue = "82679",
98    reason = "`cfg_eval` is a recently implemented feature"
99)]
100pub use crate::macros::builtin::cfg_eval;
101
102#[unstable(
103    feature = "type_ascription",
104    issue = "23416",
105    reason = "placeholder syntax for type ascription"
106)]
107pub use crate::macros::builtin::type_ascribe;
108
109#[unstable(
110    feature = "deref_patterns",
111    issue = "87121",
112    reason = "placeholder syntax for deref patterns"
113)]
114pub use crate::macros::builtin::deref;
115
116#[unstable(
117    feature = "type_alias_impl_trait",
118    issue = "63063",
119    reason = "`type_alias_impl_trait` has open design concerns"
120)]
121pub use crate::macros::builtin::define_opaque;
122
123#[unstable(feature = "extern_item_impls", issue = "125418")]
124pub use crate::macros::builtin::{eii, unsafe_eii};
125
126#[unstable(feature = "eii_internals", issue = "none")]
127pub use crate::macros::builtin::eii_extern_target;