Skip to content

Commit bf16a22

Browse files
authored
Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix
Create (unstable) 2024 edition [On Zulip](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Deprecating.20macro.20scoping.20shenanigans/near/272860652), there was a small aside regarding creating the 2024 edition now as opposed to later. There was a reasonable amount of support and no stated opposition. This change creates the 2024 edition in the compiler and creates a prelude for the 2024 edition. There is no current difference between the 2021 and 2024 editions. Cargo and other tools will need to be updated separately, as it's not in the same repository. This change permits the vast majority of work towards the next edition to proceed _now_ instead of waiting until 2024. For sanity purposes, I've merged the "hello" UI tests into a single file with multiple revisions. Otherwise we'd end up with a file per edition, despite them being essentially identical. ````@rustbot```` label +T-lang +S-waiting-on-review Not sure on the relevant team, to be honest.
2 parents 71864b7 + 8b6be69 commit bf16a22

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

core/src/prelude/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ pub mod rust_2021 {
4545
#[doc(no_inline)]
4646
pub use crate::convert::{TryFrom, TryInto};
4747
}
48+
49+
/// The 2024 edition of the core prelude.
50+
///
51+
/// See the [module-level documentation](self) for more.
52+
#[unstable(feature = "prelude_2024", issue = "none")]
53+
pub mod rust_2024 {
54+
#[unstable(feature = "prelude_2024", issue = "none")]
55+
#[doc(no_inline)]
56+
pub use super::rust_2021::*;
57+
}

std/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@
279279
#![feature(panic_info_message)]
280280
#![feature(panic_internals)]
281281
#![feature(portable_simd)]
282+
#![feature(prelude_2024)]
282283
#![feature(ptr_as_uninit)]
283284
#![feature(raw_os_nonzero)]
284285
#![feature(slice_internals)]

std/src/prelude/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,17 @@ pub mod rust_2021 {
132132
#[doc(no_inline)]
133133
pub use core::prelude::rust_2021::*;
134134
}
135+
136+
/// The 2024 version of the prelude of The Rust Standard Library.
137+
///
138+
/// See the [module-level documentation](self) for more.
139+
#[unstable(feature = "prelude_2024", issue = "none")]
140+
pub mod rust_2024 {
141+
#[unstable(feature = "prelude_2024", issue = "none")]
142+
#[doc(no_inline)]
143+
pub use super::v1::*;
144+
145+
#[unstable(feature = "prelude_2024", issue = "none")]
146+
#[doc(no_inline)]
147+
pub use core::prelude::rust_2024::*;
148+
}

0 commit comments

Comments
 (0)