Skip to content

Commit 34b5e3c

Browse files
committed
Soft-destabilize RustcEncodable/RustcDecodable
1 parent ad36b5a commit 34b5e3c

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
@@ -1575,20 +1575,28 @@ pub(crate) mod builtin {
15751575
/* compiler built-in */
15761576
}
15771577

1578-
/// Unstable implementation detail of the `rustc` compiler, do not use.
1578+
/// Derive macro for `rustc-serialize`. Should not be used in new code.
15791579
#[rustc_builtin_macro]
1580-
#[stable(feature = "rust1", since = "1.0.0")]
1581-
#[allow_internal_unstable(core_intrinsics, libstd_sys_internals, rt)]
1580+
#[unstable(
1581+
feature = "rustc_encodable_decodable",
1582+
issue = "none",
1583+
soft,
1584+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
1585+
)]
15821586
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
15831587
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
15841588
pub macro RustcDecodable($item:item) {
15851589
/* compiler built-in */
15861590
}
15871591

1588-
/// Unstable implementation detail of the `rustc` compiler, do not use.
1592+
/// Derive macro for `rustc-serialize`. Should not be used in new code.
15891593
#[rustc_builtin_macro]
1590-
#[stable(feature = "rust1", since = "1.0.0")]
1591-
#[allow_internal_unstable(core_intrinsics, rt)]
1594+
#[unstable(
1595+
feature = "rustc_encodable_decodable",
1596+
issue = "none",
1597+
soft,
1598+
reason = "derive macro for `rustc-serialize`; should not be used in new code"
1599+
)]
15921600
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
15931601
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
15941602
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)