about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2019-11-09 22:27:52 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2019-11-17 22:37:14 +0100
commit2ba84c6bea8ce018d81b3eb2ef923aeb996f02f0 (patch)
tree6e7c15ae2a7d82455569f24ef4f9505b4b385a94
parenta265bc22f161c7399c5a35835305d2dacf24753a (diff)
HashStable_Generic for librustc_target.
-rw-r--r--Cargo.lock1
-rw-r--r--src/librustc/ich/impls_syntax.rs23
-rw-r--r--src/librustc_target/Cargo.toml1
-rw-r--r--src/librustc_target/spec/abi.rs5
4 files changed, 6 insertions, 24 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 34bcba89261..4c1dfd59e42 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3844,6 +3844,7 @@ dependencies = [
  "log",
  "rustc_data_structures",
  "rustc_index",
+ "rustc_macros",
  "serialize",
  "syntax_pos",
 ]
diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs
index 42d6576ba6d..f8bf8f4ab8a 100644
--- a/src/librustc/ich/impls_syntax.rs
+++ b/src/librustc/ich/impls_syntax.rs
@@ -17,29 +17,6 @@ use crate::hir::def_id::{DefId, CrateNum, CRATE_DEF_INDEX};
 use smallvec::SmallVec;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 
-impl_stable_hash_for!(enum ::rustc_target::spec::abi::Abi {
-    Cdecl,
-    Stdcall,
-    Fastcall,
-    Vectorcall,
-    Thiscall,
-    Aapcs,
-    Win64,
-    SysV64,
-    PtxKernel,
-    Msp430Interrupt,
-    X86Interrupt,
-    AmdGpuKernel,
-    EfiApi,
-    Rust,
-    C,
-    System,
-    RustIntrinsic,
-    RustCall,
-    PlatformIntrinsic,
-    Unadjusted
-});
-
 impl_stable_hash_for!(struct ::syntax::ast::Lit {
     kind,
     token,
diff --git a/src/librustc_target/Cargo.toml b/src/librustc_target/Cargo.toml
index c73d0adea38..0e0732490fb 100644
--- a/src/librustc_target/Cargo.toml
+++ b/src/librustc_target/Cargo.toml
@@ -12,6 +12,7 @@ path = "lib.rs"
 bitflags = "1.2.1"
 log = "0.4"
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_macros = { path = "../librustc_macros" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 syntax_pos = { path = "../libsyntax_pos" }
 rustc_index = { path = "../librustc_index" }
diff --git a/src/librustc_target/spec/abi.rs b/src/librustc_target/spec/abi.rs
index 3a24d30966f..736358a995b 100644
--- a/src/librustc_target/spec/abi.rs
+++ b/src/librustc_target/spec/abi.rs
@@ -1,9 +1,12 @@
 use std::fmt;
 
+use rustc_macros::HashStable_Generic;
+
 #[cfg(test)]
 mod tests;
 
-#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, Clone, Copy, Debug)]
+#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable,
+         Clone, Copy, Debug, HashStable_Generic)]
 pub enum Abi {
     // N.B., this ordering MUST match the AbiDatas array below.
     // (This is ensured by the test indices_are_correct().)