Skip to content

Commit 3936aff

Browse files
committed
Use derive macro for HashStable
1 parent 48757a7 commit 3936aff

36 files changed

+358
-2622
lines changed

src/librustc/hir/def.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ use crate::util::nodemap::{NodeMap, DefIdMap};
33
use syntax::ast;
44
use syntax::ext::base::MacroKind;
55
use syntax_pos::Span;
6+
use rustc_macros::HashStable;
67
use crate::hir;
78
use crate::ty;
89

910
use self::Namespace::*;
1011

11-
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
12+
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, HashStable)]
1213
pub enum CtorKind {
1314
/// Constructor function automatically created by a tuple struct/variant.
1415
Fn,
@@ -18,7 +19,7 @@ pub enum CtorKind {
1819
Fictive,
1920
}
2021

21-
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
22+
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, HashStable)]
2223
pub enum NonMacroAttrKind {
2324
/// Single-segment attribute defined by the language (`#[inline]`)
2425
Builtin,
@@ -32,7 +33,7 @@ pub enum NonMacroAttrKind {
3233
Custom,
3334
}
3435

35-
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
36+
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, HashStable)]
3637
pub enum Def {
3738
// Type namespace
3839
Mod(DefId),
@@ -209,7 +210,7 @@ pub type ExportMap = DefIdMap<Vec<Export>>;
209210
/// namespace.
210211
pub type ImportMap = NodeMap<PerNS<Option<PathResolution>>>;
211212

212-
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
213+
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
213214
pub struct Export {
214215
/// The name of the target.
215216
pub ident: ast::Ident,

0 commit comments

Comments
 (0)