Skip to content

Commit

Permalink
Use derive macro for HashStable
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 12, 2019
1 parent 48757a7 commit 3936aff
Show file tree
Hide file tree
Showing 36 changed files with 358 additions and 2,622 deletions.
9 changes: 5 additions & 4 deletions src/librustc/hir/def.rs
Expand Up @@ -3,12 +3,13 @@ use crate::util::nodemap::{NodeMap, DefIdMap};
use syntax::ast;
use syntax::ext::base::MacroKind;
use syntax_pos::Span;
use rustc_macros::HashStable;
use crate::hir;
use crate::ty;

use self::Namespace::*;

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

#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, HashStable)]
pub enum NonMacroAttrKind {
/// Single-segment attribute defined by the language (`#[inline]`)
Builtin,
Expand All @@ -32,7 +33,7 @@ pub enum NonMacroAttrKind {
Custom,
}

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

#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable)]
#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable, HashStable)]
pub struct Export {
/// The name of the target.
pub ident: ast::Ident,
Expand Down

0 comments on commit 3936aff

Please sign in to comment.