about summary refs log tree commit diff
path: root/src/librustc_hir/def.rs
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2020-06-11 15:49:57 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2020-08-14 17:34:30 +0100
commitcbcef3effcf64bd0d89ea2dc8973e18d7fcf94c3 (patch)
treecf11d5e77bdfe87b0a19d5f93ff251b256770325 /src/librustc_hir/def.rs
parent55b9adfafa11b2ced5c0477c949fd875b19b3877 (diff)
downloadrust-cbcef3effcf64bd0d89ea2dc8973e18d7fcf94c3.tar.gz
rust-cbcef3effcf64bd0d89ea2dc8973e18d7fcf94c3.zip
Rework `rustc_serialize`
- Move the type parameter from `encode` and `decode` methods to
  the trait.
- Remove `UseSpecialized(En|De)codable` traits.
- Remove blanket impls for references.
- Add `RefDecodable` trait to allow deserializing to arena-allocated
  references safely.
- Remove ability to (de)serialize HIR.
- Create proc-macros `(Ty)?(En|De)codable` to help implement these new
  traits.
Diffstat (limited to 'src/librustc_hir/def.rs')
-rw-r--r--src/librustc_hir/def.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_hir/def.rs b/src/librustc_hir/def.rs
index 618f3e99c3f..c4877be3f64 100644
--- a/src/librustc_hir/def.rs
+++ b/src/librustc_hir/def.rs
@@ -9,7 +9,7 @@ use rustc_span::hygiene::MacroKind;
 use std::fmt::Debug;
 
 /// Encodes if a `DefKind::Ctor` is the constructor of an enum variant or a struct.
-#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
 #[derive(HashStable_Generic)]
 pub enum CtorOf {
     /// This `DefKind::Ctor` is a synthesized constructor of a tuple or unit struct.
@@ -18,7 +18,7 @@ pub enum CtorOf {
     Variant,
 }
 
-#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
 #[derive(HashStable_Generic)]
 pub enum CtorKind {
     /// Constructor function automatically created by a tuple struct/variant.
@@ -29,7 +29,7 @@ pub enum CtorKind {
     Fictive,
 }
 
-#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
 #[derive(HashStable_Generic)]
 pub enum NonMacroAttrKind {
     /// Single-segment attribute defined by the language (`#[inline]`)
@@ -42,7 +42,7 @@ pub enum NonMacroAttrKind {
     Registered,
 }
 
-#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
 #[derive(HashStable_Generic)]
 pub enum DefKind {
     // Type namespace
@@ -191,7 +191,7 @@ impl DefKind {
 }
 
 /// The resolution of a path or export.
-#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug)]
 #[derive(HashStable_Generic)]
 pub enum Res<Id = hir::HirId> {
     Def(DefKind, DefId),