Skip to content

Commit 2624e91

Browse files
jhprattdtolnay
authored andcommitted
Soft-destabilize RustcEncodable/RustcDecodable
1 parent b3df0d7 commit 2624e91

File tree

4 files changed

+32
-18
lines changed

4 files changed

+32
-18
lines changed

library/core/src/macros/mod.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -1726,20 +1726,28 @@ pub(crate) mod builtin {
17261726
builtin # deref($pat)
17271727
}
17281728

1729-
/// Unstable implementation detail of the `rustc` compiler, do not use.
1729+
/// Derive macro for `rustc-serialize`. Should not be used in new code.
17301730
#[rustc_builtin_macro]
1731-
#[stable(feature = "rust1", since = "1.0.0")]
1732-
#[allow_internal_unstable(core_intrinsics, libstd_sys_internals, rt)]
1731+
#[unstable(
1732+
feature = "rustc_encodable_decodable",
1733+
issue = "none",
1734+
soft,
1735+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
1736+
)]
17331737
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
17341738
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
17351739
pub macro RustcDecodable($item:item) {
17361740
/* compiler built-in */
17371741
}
17381742

1739-
/// Unstable implementation detail of the `rustc` compiler, do not use.
1743+
/// Derive macro for `rustc-serialize`. Should not be used in new code.
17401744
#[rustc_builtin_macro]
1741-
#[stable(feature = "rust1", since = "1.0.0")]
1742-
#[allow_internal_unstable(core_intrinsics, rt)]
1745+
#[unstable(
1746+
feature = "rustc_encodable_decodable",
1747+
issue = "none",
1748+
soft,
1749+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
1750+
)]
17431751
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
17441752
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
17451753
pub macro RustcEncodable($item:item) {

library/core/src/prelude/v1.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ pub use crate::{
6969
pub use crate::concat_bytes;
7070

7171
// Do not `doc(inline)` these `doc(hidden)` items.
72-
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
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+
)]
7378
#[allow(deprecated)]
7479
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
7580

library/std/src/prelude/v1.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ pub use core::prelude::v1::{
5353
pub use core::prelude::v1::concat_bytes;
5454

5555
// Do not `doc(inline)` these `doc(hidden)` items.
56-
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
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+
)]
5762
#[allow(deprecated)]
5863
pub use core::prelude::v1::{RustcDecodable, RustcEncodable};
5964

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
#[crate_type="lib"]
2-
31
// #13544
42

5-
extern crate rustc_serialize;
6-
7-
#[derive(RustcEncodable)] pub struct A;
8-
#[derive(RustcEncodable)] pub struct B(isize);
9-
#[derive(RustcEncodable)] pub struct C { x: isize }
10-
#[derive(RustcEncodable)] pub enum D {}
11-
#[derive(RustcEncodable)] pub enum E { y }
12-
#[derive(RustcEncodable)] pub enum F { z(isize) }
3+
#[derive(Debug)] pub struct A;
4+
#[derive(Debug)] pub struct B(isize);
5+
#[derive(Debug)] pub struct C { x: isize }
6+
#[derive(Debug)] pub enum D {}
7+
#[derive(Debug)] pub enum E { y }
8+
#[derive(Debug)] pub enum F { z(isize) }

0 commit comments

Comments
 (0)