Skip to content

Commit

Permalink
Auto merge of rust-lang#85687 - m-ou-se:new-prelude, r=yaahc
Browse files Browse the repository at this point in the history
New prelude

RFC: rust-lang/rfcs#3114
Tracking issue: rust-lang#85684
  • Loading branch information
bors committed Jun 2, 2021
2 parents 153f22a + 4f93b06 commit c4f186f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
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();
}

0 comments on commit c4f186f

Please sign in to comment.