]> git.lizzy.rs Git - rust.git/commitdiff
add rt flag to allowed internal unstable for RustcEncodable/Decodable
authorJane Lusby <jlusby@yaah.dev>
Mon, 13 Jun 2022 22:05:19 +0000 (15:05 -0700)
committerJane Losare-Lusby <jlusby@yaah.dev>
Fri, 8 Jul 2022 21:18:15 +0000 (21:18 +0000)
library/core/src/macros/mod.rs
src/test/ui/stability-attribute/rustc-encodable-stability.rs [new file with mode: 0644]

index 673a39c298f7d2f6ae4f14ff7b32a0650e1f535c..bd62bc5c3056c82a67affec256a05cdc8221e44b 100644 (file)
@@ -1537,7 +1537,7 @@ macro_rules! trace_macros {
     /// Unstable implementation detail of the `rustc` compiler, do not use.
     #[rustc_builtin_macro]
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[allow_internal_unstable(core_intrinsics, libstd_sys_internals)]
+    #[allow_internal_unstable(core_intrinsics, libstd_sys_internals, rt)]
     #[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.
     pub macro RustcDecodable($item:item) {
@@ -1547,7 +1547,7 @@ macro_rules! trace_macros {
     /// Unstable implementation detail of the `rustc` compiler, do not use.
     #[rustc_builtin_macro]
     #[stable(feature = "rust1", since = "1.0.0")]
-    #[allow_internal_unstable(core_intrinsics)]
+    #[allow_internal_unstable(core_intrinsics, rt)]
     #[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.
     pub macro RustcEncodable($item:item) {
diff --git a/src/test/ui/stability-attribute/rustc-encodable-stability.rs b/src/test/ui/stability-attribute/rustc-encodable-stability.rs
new file mode 100644 (file)
index 0000000..18eff27
--- /dev/null
@@ -0,0 +1,8 @@
+// edition:2018
+#![allow(deprecated)]
+extern crate rustc_serialize;
+
+#[derive(RustcDecodable, RustcEncodable)]
+struct ArbitraryTestType(());
+
+fn main() {}