Soft-destabilize RustcEncodable/RustcDecodable

This commit is contained in:
Jacob Pratt 2023-09-21 00:06:22 +00:00 committed by David Tolnay
parent b3df0d7e5e
commit 2624e9183d
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
4 changed files with 32 additions and 18 deletions

View File

@ -1726,20 +1726,28 @@ macro_rules! trace_macros {
builtin # deref($pat) builtin # deref($pat)
} }
/// Unstable implementation detail of the `rustc` compiler, do not use. /// Derive macro for `rustc-serialize`. Should not be used in new code.
#[rustc_builtin_macro] #[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")] #[unstable(
#[allow_internal_unstable(core_intrinsics, libstd_sys_internals, rt)] feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "derive macro for `rustc-serialize`; should not be used in new code"
)]
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")] #[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it. #[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
pub macro RustcDecodable($item:item) { pub macro RustcDecodable($item:item) {
/* compiler built-in */ /* compiler built-in */
} }
/// Unstable implementation detail of the `rustc` compiler, do not use. /// Derive macro for `rustc-serialize`. Should not be used in new code.
#[rustc_builtin_macro] #[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")] #[unstable(
#[allow_internal_unstable(core_intrinsics, rt)] feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "derive macro for `rustc-serialize`; should not be used in new code"
)]
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")] #[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it. #[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
pub macro RustcEncodable($item:item) { pub macro RustcEncodable($item:item) {

View File

@ -69,7 +69,12 @@
pub use crate::concat_bytes; pub use crate::concat_bytes;
// Do not `doc(inline)` these `doc(hidden)` items. // Do not `doc(inline)` these `doc(hidden)` items.
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[unstable(
feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "unstable implementation detail of the `rustc` compiler, do not use"
)]
#[allow(deprecated)] #[allow(deprecated)]
pub use crate::macros::builtin::{RustcDecodable, RustcEncodable}; pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};

View File

@ -53,7 +53,12 @@
pub use core::prelude::v1::concat_bytes; pub use core::prelude::v1::concat_bytes;
// Do not `doc(inline)` these `doc(hidden)` items. // Do not `doc(inline)` these `doc(hidden)` items.
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[unstable(
feature = "rustc_encodable_decodable",
issue = "none",
soft,
reason = "unstable implementation detail of the `rustc` compiler, do not use"
)]
#[allow(deprecated)] #[allow(deprecated)]
pub use core::prelude::v1::{RustcDecodable, RustcEncodable}; pub use core::prelude::v1::{RustcDecodable, RustcEncodable};

View File

@ -1,12 +1,8 @@
#[crate_type="lib"]
// #13544 // #13544
extern crate rustc_serialize; #[derive(Debug)] pub struct A;
#[derive(Debug)] pub struct B(isize);
#[derive(RustcEncodable)] pub struct A; #[derive(Debug)] pub struct C { x: isize }
#[derive(RustcEncodable)] pub struct B(isize); #[derive(Debug)] pub enum D {}
#[derive(RustcEncodable)] pub struct C { x: isize } #[derive(Debug)] pub enum E { y }
#[derive(RustcEncodable)] pub enum D {} #[derive(Debug)] pub enum F { z(isize) }
#[derive(RustcEncodable)] pub enum E { y }
#[derive(RustcEncodable)] pub enum F { z(isize) }