2022-10-28 15:34:29 -07:00
|
|
|
//! The core prelude
|
2021-02-17 13:33:47 +01:00
|
|
|
//!
|
2022-10-28 15:34:29 -07:00
|
|
|
//! This module is intended for users of core which do not link to std as well.
|
|
|
|
|
//! This module is imported by default when `#![no_std]` is used in the same
|
|
|
|
|
//! manner as the standard library's prelude.
|
2015-07-29 17:01:14 -07:00
|
|
|
|
2015-08-17 14:02:15 -07:00
|
|
|
#![stable(feature = "core_prelude", since = "1.4.0")]
|
|
|
|
|
|
2023-09-21 00:56:59 +00:00
|
|
|
mod common;
|
|
|
|
|
|
|
|
|
|
/// The first version of the prelude of The Rust Standard Library.
|
|
|
|
|
///
|
|
|
|
|
/// See the [module-level documentation](self) for more.
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub mod v1 {
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub use super::common::*;
|
|
|
|
|
|
|
|
|
|
// Do not `doc(inline)` these `doc(hidden)` items.
|
|
|
|
|
#[unstable(
|
|
|
|
|
feature = "rustc_encodable_decodable",
|
|
|
|
|
issue = "none",
|
|
|
|
|
soft,
|
|
|
|
|
reason = "derive macro for `rustc-serialize`; should not be used in new code"
|
|
|
|
|
)]
|
|
|
|
|
#[allow(deprecated)]
|
|
|
|
|
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
|
|
|
|
|
}
|
2021-02-17 13:33:47 +01:00
|
|
|
|
|
|
|
|
/// The 2015 version of the core prelude.
|
|
|
|
|
///
|
2021-02-25 12:41:39 +01:00
|
|
|
/// See the [module-level documentation](self) for more.
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2015", since = "1.55.0")]
|
2021-02-17 13:33:47 +01:00
|
|
|
pub mod rust_2015 {
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2015", since = "1.55.0")]
|
2021-02-17 13:33:47 +01:00
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use super::v1::*;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// The 2018 version of the core prelude.
|
|
|
|
|
///
|
2021-02-25 12:41:39 +01:00
|
|
|
/// See the [module-level documentation](self) for more.
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2018", since = "1.55.0")]
|
2021-02-17 13:33:47 +01:00
|
|
|
pub mod rust_2018 {
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2018", since = "1.55.0")]
|
2021-02-17 13:33:47 +01:00
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use super::v1::*;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// The 2021 version of the core prelude.
|
|
|
|
|
///
|
2021-02-25 12:41:39 +01:00
|
|
|
/// See the [module-level documentation](self) for more.
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2021", since = "1.55.0")]
|
2021-02-17 13:33:47 +01:00
|
|
|
pub mod rust_2021 {
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2021", since = "1.55.0")]
|
2021-02-17 13:33:47 +01:00
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use super::v1::*;
|
|
|
|
|
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2021", since = "1.55.0")]
|
2021-05-25 19:58:50 +02:00
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use crate::iter::FromIterator;
|
|
|
|
|
|
2021-06-14 14:44:50 +00:00
|
|
|
#[stable(feature = "prelude_2021", since = "1.55.0")]
|
2021-05-25 19:58:50 +02:00
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use crate::convert::{TryFrom, TryInto};
|
2021-02-17 13:33:47 +01:00
|
|
|
}
|
2022-02-28 18:13:24 -05:00
|
|
|
|
2023-09-21 00:56:59 +00:00
|
|
|
/// The 2024 version of the core prelude.
|
2022-02-28 18:13:24 -05:00
|
|
|
///
|
|
|
|
|
/// See the [module-level documentation](self) for more.
|
2024-02-13 18:35:17 +01:00
|
|
|
#[unstable(feature = "prelude_2024", issue = "121042")]
|
2022-02-28 18:13:24 -05:00
|
|
|
pub mod rust_2024 {
|
2023-09-21 00:56:59 +00:00
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
|
pub use super::common::*;
|
|
|
|
|
|
|
|
|
|
#[stable(feature = "prelude_2021", since = "1.55.0")]
|
|
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use crate::iter::FromIterator;
|
|
|
|
|
|
|
|
|
|
#[stable(feature = "prelude_2021", since = "1.55.0")]
|
2022-02-28 18:13:24 -05:00
|
|
|
#[doc(no_inline)]
|
2023-09-21 00:56:59 +00:00
|
|
|
pub use crate::convert::{TryFrom, TryInto};
|
2024-02-13 18:35:17 +01:00
|
|
|
|
|
|
|
|
#[unstable(feature = "prelude_2024", issue = "121042")]
|
|
|
|
|
#[doc(no_inline)]
|
|
|
|
|
pub use crate::future::{Future, IntoFuture};
|
2022-02-28 18:13:24 -05:00
|
|
|
}
|