Skip to content

Commit

Permalink
Rollup merge of rust-lang#83160 - m-ou-se:deprecate-rustc-serialize-d…
Browse files Browse the repository at this point in the history
…erives, r=petrochenkov

Deprecate RustcEncodable and RustcDecodable.

We can't remove the `RustcEncodable` and `RustcDecodable` derive macros from the prelude, but we can deprecate them.
  • Loading branch information
Dylan-DPC committed Mar 16, 2021
2 parents afcd0a6 + 924e522 commit 1a513c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,10 @@ pub(crate) mod builtin {
#[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(core_intrinsics, libstd_sys_internals)]
#[rustc_deprecated(
since = "1.52.0",
reason = "rustc-serialize is deprecated and no longer supported"
)]
pub macro RustcDecodable($item:item) {
/* compiler built-in */
}
Expand All @@ -1476,6 +1480,10 @@ pub(crate) mod builtin {
#[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(core_intrinsics)]
#[rustc_deprecated(
since = "1.52.0",
reason = "rustc-serialize is deprecated and no longer supported"
)]
pub macro RustcEncodable($item:item) {
/* compiler built-in */
}
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub use crate::{
};

#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
#[allow(deprecated, deprecated_in_future)]
#[doc(no_inline)]
pub use crate::macros::builtin::{
bench, global_allocator, test, test_case, RustcDecodable, RustcEncodable,
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub use core::prelude::v1::{
// FIXME: Attribute and internal derive macros are not documented because for them rustdoc generates
// dead links which fail link checker testing.
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
#[allow(deprecated, deprecated_in_future)]
#[doc(hidden)]
pub use core::prelude::v1::{
bench, global_allocator, test, test_case, RustcDecodable, RustcEncodable,
Expand Down

0 comments on commit 1a513c4

Please sign in to comment.