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)]
19pub use crate::ops::{AsyncFn, AsyncFnMut, AsyncFnOnce};
20
21// Re-exported functions
22#[stable(feature = "core_prelude", since = "1.4.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 = "core_prelude", since = "1.4.0")]
31#[doc(no_inline)]
32pub use crate::clone::Clone;
33#[stable(feature = "core_prelude", since = "1.4.0")]
34#[doc(no_inline)]
35pub use crate::cmp::{Eq, Ord, PartialEq, PartialOrd};
36#[stable(feature = "core_prelude", since = "1.4.0")]
37#[doc(no_inline)]
38pub use crate::convert::{AsMut, AsRef, From, Into};
39#[stable(feature = "core_prelude", since = "1.4.0")]
40#[doc(no_inline)]
41pub use crate::default::Default;
42#[stable(feature = "core_prelude", since = "1.4.0")]
43#[doc(no_inline)]
44pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator, Extend, IntoIterator, Iterator};
45#[stable(feature = "core_prelude", since = "1.4.0")]
46#[doc(no_inline)]
47pub use crate::option::Option::{self, None, Some};
48#[stable(feature = "core_prelude", since = "1.4.0")]
49#[doc(no_inline)]
50pub use crate::result::Result::{self, Err, Ok};
51
52// Re-exported built-in macros
53#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
54#[doc(no_inline)]
55pub use crate::fmt::macros::Debug;
56#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
57#[doc(no_inline)]
58pub use crate::hash::macros::Hash;
59
60#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
61#[allow(deprecated)]
62#[cfg_attr(bootstrap, allow(deprecated_in_future))]
63#[doc(no_inline)]
64pub use crate::{
65    assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
66    format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
67    stringify, trace_macros,
68};
69
70#[unstable(
71    feature = "concat_bytes",
72    issue = "87555",
73    reason = "`concat_bytes` is not stable enough for use and is subject to change"
74)]
75#[doc(no_inline)]
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 = "none")]
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;