Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New prelude #85687

Merged
merged 3 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions library/core/src/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,37 @@ pub mod v1;
/// The 2015 version of the core prelude.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2015", issue = "none")]
#[unstable(feature = "prelude_2015", issue = "85684")]
pub mod rust_2015 {
#[unstable(feature = "prelude_2015", issue = "none")]
#[unstable(feature = "prelude_2015", issue = "85684")]
#[doc(no_inline)]
pub use super::v1::*;
}

/// The 2018 version of the core prelude.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2018", issue = "none")]
#[unstable(feature = "prelude_2018", issue = "85684")]
pub mod rust_2018 {
#[unstable(feature = "prelude_2018", issue = "none")]
#[unstable(feature = "prelude_2018", issue = "85684")]
#[doc(no_inline)]
pub use super::v1::*;
}

/// The 2021 version of the core prelude.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2021", issue = "none")]
#[unstable(feature = "prelude_2021", issue = "85684")]
pub mod rust_2021 {
#[unstable(feature = "prelude_2021", issue = "none")]
#[unstable(feature = "prelude_2021", issue = "85684")]
#[doc(no_inline)]
pub use super::v1::*;

// FIXME: Add more things.
#[unstable(feature = "prelude_2021", issue = "85684")]
#[doc(no_inline)]
pub use crate::iter::FromIterator;

#[unstable(feature = "prelude_2021", issue = "85684")]
#[doc(no_inline)]
pub use crate::convert::{TryFrom, TryInto};
}
14 changes: 7 additions & 7 deletions library/std/src/prelude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,33 +88,33 @@ pub mod v1;
/// The 2015 version of the prelude of The Rust Standard Library.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2015", issue = "none")]
#[unstable(feature = "prelude_2015", issue = "85684")]
pub mod rust_2015 {
#[unstable(feature = "prelude_2015", issue = "none")]
#[unstable(feature = "prelude_2015", issue = "85684")]
#[doc(no_inline)]
pub use super::v1::*;
}

/// The 2018 version of the prelude of The Rust Standard Library.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2018", issue = "none")]
#[unstable(feature = "prelude_2018", issue = "85684")]
pub mod rust_2018 {
#[unstable(feature = "prelude_2018", issue = "none")]
#[unstable(feature = "prelude_2018", issue = "85684")]
#[doc(no_inline)]
pub use super::v1::*;
}

/// The 2021 version of the prelude of The Rust Standard Library.
///
/// See the [module-level documentation](self) for more.
#[unstable(feature = "prelude_2021", issue = "none")]
#[unstable(feature = "prelude_2021", issue = "85684")]
pub mod rust_2021 {
#[unstable(feature = "prelude_2021", issue = "none")]
#[unstable(feature = "prelude_2021", issue = "85684")]
#[doc(no_inline)]
pub use super::v1::*;

#[unstable(feature = "prelude_2021", issue = "none")]
#[unstable(feature = "prelude_2021", issue = "85684")]
#[doc(no_inline)]
pub use core::prelude::rust_2021::*;
}
7 changes: 7 additions & 0 deletions src/test/ui/prelude2021.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// check-pass
// edition:2021
// compile-flags: -Zunstable-options

fn main() {
let _: u16 = 123i32.try_into().unwrap();
}