Skip to content

Commit fc53982

Browse files
jhprattdtolnay
authored andcommitted
Remove RustcEncodable/Decodable from 2024 prelude
1 parent ca0e3c3 commit fc53982

File tree

4 files changed

+54
-34
lines changed

4 files changed

+54
-34
lines changed

core/src/prelude/v1.rs renamed to core/src/prelude/common.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
//! The first version of the core prelude.
1+
//! Items common to the prelude of all editions.
22
//!
33
//! See the [module-level documentation](super) for more.
44
5-
#![stable(feature = "core_prelude", since = "1.4.0")]
6-
75
// Re-exported core operators
86
#[stable(feature = "core_prelude", since = "1.4.0")]
97
#[doc(no_inline)]
@@ -68,16 +66,6 @@ pub use crate::{
6866
#[doc(no_inline)]
6967
pub use crate::concat_bytes;
7068

71-
// Do not `doc(inline)` these `doc(hidden)` items.
72-
#[unstable(
73-
feature = "rustc_encodable_decodable",
74-
issue = "none",
75-
soft,
76-
reason = "unstable implementation detail of the `rustc` compiler, do not use"
77-
)]
78-
#[allow(deprecated)]
79-
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
80-
8169
// Do not `doc(no_inline)` so that they become doc items on their own
8270
// (no public module for them to be re-exported from).
8371
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

core/src/prelude/mod.rs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,26 @@
66
77
#![stable(feature = "core_prelude", since = "1.4.0")]
88

9-
pub mod v1;
9+
mod 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")]
15+
pub 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+
}
1029

1130
/// The 2015 version of the core prelude.
1231
///
@@ -46,14 +65,21 @@ pub mod rust_2021 {
4665
pub use crate::convert::{TryFrom, TryInto};
4766
}
4867

49-
/// The 2024 edition of the core prelude.
68+
/// The 2024 version of the core prelude.
5069
///
5170
/// See the [module-level documentation](self) for more.
5271
#[unstable(feature = "prelude_2024", issue = "121042")]
5372
pub mod rust_2024 {
54-
#[unstable(feature = "prelude_2024", issue = "121042")]
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")]
5581
#[doc(no_inline)]
56-
pub use super::rust_2021::*;
82+
pub use crate::convert::{TryFrom, TryInto};
5783

5884
#[unstable(feature = "prelude_2024", issue = "121042")]
5985
#[doc(no_inline)]

std/src/prelude/v1.rs renamed to std/src/prelude/common.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
//! The first version of the prelude of The Rust Standard Library.
1+
//! Items common to the prelude of all editions.
22
//!
33
//! See the [module-level documentation](super) for more.
44
5-
#![stable(feature = "rust1", since = "1.0.0")]
6-
75
// Re-exported core operators
86
#[stable(feature = "rust1", since = "1.0.0")]
97
#[doc(no_inline)]
@@ -52,16 +50,6 @@ pub use core::prelude::v1::{
5250
#[doc(no_inline)]
5351
pub use core::prelude::v1::concat_bytes;
5452

55-
// Do not `doc(inline)` these `doc(hidden)` items.
56-
#[unstable(
57-
feature = "rustc_encodable_decodable",
58-
issue = "none",
59-
soft,
60-
reason = "unstable implementation detail of the `rustc` compiler, do not use"
61-
)]
62-
#[allow(deprecated)]
63-
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
64-
6553
// Do not `doc(no_inline)` so that they become doc items on their own
6654
// (no public module for them to be re-exported from).
6755
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

std/src/prelude/mod.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,26 @@
9393
9494
#![stable(feature = "rust1", since = "1.0.0")]
9595

96-
pub mod v1;
96+
mod common;
97+
98+
/// The first version of the prelude of The Rust Standard Library.
99+
///
100+
/// See the [module-level documentation](self) for more.
101+
#[stable(feature = "rust1", since = "1.0.0")]
102+
pub mod v1 {
103+
#[stable(feature = "rust1", since = "1.0.0")]
104+
pub use super::common::*;
105+
106+
// Do not `doc(inline)` these `doc(hidden)` items.
107+
#[unstable(
108+
feature = "rustc_encodable_decodable",
109+
issue = "none",
110+
soft,
111+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
112+
)]
113+
#[allow(deprecated)]
114+
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
115+
}
97116

98117
/// The 2015 version of the prelude of The Rust Standard Library.
99118
///
@@ -134,9 +153,8 @@ pub mod rust_2021 {
134153
/// See the [module-level documentation](self) for more.
135154
#[unstable(feature = "prelude_2024", issue = "121042")]
136155
pub mod rust_2024 {
137-
#[unstable(feature = "prelude_2024", issue = "121042")]
138-
#[doc(no_inline)]
139-
pub use super::v1::*;
156+
#[stable(feature = "rust1", since = "1.0.0")]
157+
pub use super::common::*;
140158

141159
#[unstable(feature = "prelude_2024", issue = "121042")]
142160
#[doc(no_inline)]

0 commit comments

Comments
 (0)