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#![stable(feature = "core_prelude", since = "1.4.0")]
8
9mod common;
10
11/// The first version of the prelude of The Rust Standard Library.
12///
13/// See the [module-level documentation](self) for more.
14#[stable(feature = "rust1", since = "1.0.0")]
15pub mod v1 {
16 #[stable(feature = "rust1", since = "1.0.0")]
17 pub use super::common::*;
18
19 // Do not `doc(inline)` these `doc(hidden)` items.
20 #[unstable(
21 feature = "rustc_encodable_decodable",
22 issue = "none",
23 soft,
24 reason = "derive macro for `rustc-serialize`; should not be used in new code"
25 )]
26 #[allow(deprecated)]
27 pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
28}
29
30/// The 2015 version of the core prelude.
31///
32/// See the [module-level documentation](self) for more.
33#[stable(feature = "prelude_2015", since = "1.55.0")]
34pub mod rust_2015 {
35 #[stable(feature = "prelude_2015", since = "1.55.0")]
36 #[doc(no_inline)]
37 pub use super::v1::*;
38}
39
40/// The 2018 version of the core prelude.
41///
42/// See the [module-level documentation](self) for more.
43#[stable(feature = "prelude_2018", since = "1.55.0")]
44pub mod rust_2018 {
45 #[stable(feature = "prelude_2018", since = "1.55.0")]
46 #[doc(no_inline)]
47 pub use super::v1::*;
48}
49
50/// The 2021 version of the core prelude.
51///
52/// See the [module-level documentation](self) for more.
53#[stable(feature = "prelude_2021", since = "1.55.0")]
54pub mod rust_2021 {
55 #[stable(feature = "prelude_2021", since = "1.55.0")]
56 #[doc(no_inline)]
57 pub use super::v1::*;
58
59 #[stable(feature = "prelude_2021", since = "1.55.0")]
60 #[doc(no_inline)]
61 pub use crate::iter::FromIterator;
62
63 #[stable(feature = "prelude_2021", since = "1.55.0")]
64 #[doc(no_inline)]
65 pub use crate::convert::{TryFrom, TryInto};
66}
67
68/// The 2024 version of the core prelude.
69///
70/// See the [module-level documentation](self) for more.
71#[unstable(feature = "prelude_2024", issue = "121042")]
72pub mod rust_2024 {
73 #[stable(feature = "rust1", since = "1.0.0")]
74 pub use super::common::*;
75
76 #[stable(feature = "prelude_2021", since = "1.55.0")]
77 #[doc(no_inline)]
78 pub use crate::iter::FromIterator;
79
80 #[stable(feature = "prelude_2021", since = "1.55.0")]
81 #[doc(no_inline)]
82 pub use crate::convert::{TryFrom, TryInto};
83
84 #[unstable(feature = "prelude_2024", issue = "121042")]
85 #[doc(no_inline)]
86 pub use crate::future::{Future, IntoFuture};
87}
88