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