core/prelude/
mod.rs

1//! The core prelude
2//!
3//! This module is intended for users of core which do not link to std as well.
4//! This module is imported by default when `#![no_std]` is used in the same
5//! manner as the standard library's prelude.
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#![stable(feature = "core_prelude", since = "1.4.0")]
11
12pub mod v1;
13
14/// The 2015 version of the core prelude.
15///
16/// See the [module-level documentation](self) for more.
17#[stable(feature = "prelude_2015", since = "1.55.0")]
18pub mod rust_2015 {
19    #[stable(feature = "prelude_2015", since = "1.55.0")]
20    #[doc(no_inline)]
21    pub use super::v1::*;
22}
23
24/// The 2018 version of the core prelude.
25///
26/// See the [module-level documentation](self) for more.
27#[stable(feature = "prelude_2018", since = "1.55.0")]
28pub mod rust_2018 {
29    #[stable(feature = "prelude_2018", since = "1.55.0")]
30    #[doc(no_inline)]
31    pub use super::v1::*;
32}
33
34/// The 2021 version of the core prelude.
35///
36/// See the [module-level documentation](self) for more.
37#[stable(feature = "prelude_2021", since = "1.55.0")]
38pub mod rust_2021 {
39    #[stable(feature = "prelude_2021", since = "1.55.0")]
40    #[doc(no_inline)]
41    pub use super::v1::*;
42
43    #[stable(feature = "prelude_2021", since = "1.55.0")]
44    #[doc(no_inline)]
45    #[cfg(not(feature = "ferrocene_certified"))]
46    pub use crate::iter::FromIterator;
47
48    #[stable(feature = "prelude_2021", since = "1.55.0")]
49    #[doc(no_inline)]
50    #[cfg(not(feature = "ferrocene_certified"))]
51    pub use crate::convert::{TryFrom, TryInto};
52}
53
54/// The 2024 version of the core prelude.
55///
56/// See the [module-level documentation](self) for more.
57#[stable(feature = "prelude_2024", since = "1.85.0")]
58pub mod rust_2024 {
59    #[stable(feature = "rust1", since = "1.0.0")]
60    #[doc(no_inline)]
61    pub use super::v1::*;
62
63    #[stable(feature = "prelude_2021", since = "1.55.0")]
64    #[doc(no_inline)]
65    #[cfg(not(feature = "ferrocene_certified"))]
66    pub use crate::iter::FromIterator;
67
68    #[stable(feature = "prelude_2021", since = "1.55.0")]
69    #[doc(no_inline)]
70    #[cfg(not(feature = "ferrocene_certified"))]
71    pub use crate::convert::{TryFrom, TryInto};
72
73    #[stable(feature = "prelude_2024", since = "1.85.0")]
74    #[doc(no_inline)]
75    #[cfg(not(feature = "ferrocene_certified"))]
76    pub use crate::future::{Future, IntoFuture};
77}
78
79/// The Future version of the core prelude.
80///
81/// See the [module-level documentation](self) for more.
82#[doc(hidden)]
83#[unstable(feature = "prelude_future", issue = "none")]
84#[cfg(not(feature = "ferrocene_certified"))]
85pub mod rust_future {
86    #[stable(feature = "rust1", since = "1.0.0")]
87    #[doc(no_inline)]
88    pub use super::v1::*;
89
90    #[stable(feature = "prelude_2021", since = "1.55.0")]
91    #[doc(no_inline)]
92    pub use crate::iter::FromIterator;
93
94    #[stable(feature = "prelude_2021", since = "1.55.0")]
95    #[doc(no_inline)]
96    pub use crate::convert::{TryFrom, TryInto};
97
98    #[stable(feature = "prelude_2024", since = "1.85.0")]
99    #[doc(no_inline)]
100    pub use crate::future::{Future, IntoFuture};
101}