Derive HashStable more.
This commit is contained in:
parent
781866f3a9
commit
e1522fa183
|
@ -1215,7 +1215,7 @@ impl UnOp {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A statement.
|
/// A statement.
|
||||||
#[derive(RustcEncodable, RustcDecodable)]
|
#[derive(RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub struct Stmt {
|
pub struct Stmt {
|
||||||
pub hir_id: HirId,
|
pub hir_id: HirId,
|
||||||
pub kind: StmtKind,
|
pub kind: StmtKind,
|
||||||
|
|
|
@ -140,13 +140,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Ty {
|
||||||
|
|
||||||
impl_stable_hash_for_spanned!(hir::BinOpKind);
|
impl_stable_hash_for_spanned!(hir::BinOpKind);
|
||||||
|
|
||||||
impl_stable_hash_for!(struct hir::Stmt {
|
|
||||||
hir_id,
|
|
||||||
kind,
|
|
||||||
span,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
impl_stable_hash_for_spanned!(ast::Name);
|
impl_stable_hash_for_spanned!(ast::Name);
|
||||||
|
|
||||||
impl<'a> HashStable<StableHashingContext<'a>> for hir::Expr {
|
impl<'a> HashStable<StableHashingContext<'a>> for hir::Expr {
|
||||||
|
|
|
@ -1589,13 +1589,12 @@ rustc_index::newtype_index! {
|
||||||
/// declared, but a type name in a non-zero universe is a placeholder
|
/// declared, but a type name in a non-zero universe is a placeholder
|
||||||
/// type -- an idealized representative of "types in general" that we
|
/// type -- an idealized representative of "types in general" that we
|
||||||
/// use for checking generic functions.
|
/// use for checking generic functions.
|
||||||
|
#[derive(HashStable)]
|
||||||
pub struct UniverseIndex {
|
pub struct UniverseIndex {
|
||||||
DEBUG_FORMAT = "U{}",
|
DEBUG_FORMAT = "U{}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_stable_hash_for!(struct UniverseIndex { private });
|
|
||||||
|
|
||||||
impl UniverseIndex {
|
impl UniverseIndex {
|
||||||
pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0);
|
pub const ROOT: UniverseIndex = UniverseIndex::from_u32_const(0);
|
||||||
|
|
||||||
|
@ -1839,7 +1838,7 @@ bitflags! {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Definition of a variant -- a struct's fields or a enum variant.
|
/// Definition of a variant -- a struct's fields or a enum variant.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, HashStable)]
|
||||||
pub struct VariantDef {
|
pub struct VariantDef {
|
||||||
/// `DefId` that identifies the variant itself.
|
/// `DefId` that identifies the variant itself.
|
||||||
/// If this variant belongs to a struct or union, then this is a copy of its `DefId`.
|
/// If this variant belongs to a struct or union, then this is a copy of its `DefId`.
|
||||||
|
@ -1848,6 +1847,7 @@ pub struct VariantDef {
|
||||||
/// If this variant is a struct variant, then this is `None`.
|
/// If this variant is a struct variant, then this is `None`.
|
||||||
pub ctor_def_id: Option<DefId>,
|
pub ctor_def_id: Option<DefId>,
|
||||||
/// Variant or struct name.
|
/// Variant or struct name.
|
||||||
|
#[stable_hasher(project = name)]
|
||||||
pub ident: Ident,
|
pub ident: Ident,
|
||||||
/// Discriminant of this variant.
|
/// Discriminant of this variant.
|
||||||
pub discr: VariantDiscr,
|
pub discr: VariantDiscr,
|
||||||
|
@ -1927,17 +1927,6 @@ impl<'tcx> VariantDef {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_stable_hash_for!(struct VariantDef {
|
|
||||||
def_id,
|
|
||||||
ctor_def_id,
|
|
||||||
ident -> (ident.name),
|
|
||||||
discr,
|
|
||||||
fields,
|
|
||||||
ctor_kind,
|
|
||||||
flags,
|
|
||||||
recovered
|
|
||||||
});
|
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)]
|
||||||
pub enum VariantDiscr {
|
pub enum VariantDiscr {
|
||||||
/// Explicit value for this variant, i.e., `X = 123`.
|
/// Explicit value for this variant, i.e., `X = 123`.
|
||||||
|
@ -2061,7 +2050,7 @@ impl Into<DataTypeKind> for AdtKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(RustcEncodable, RustcDecodable, Default)]
|
#[derive(RustcEncodable, RustcDecodable, Default, HashStable)]
|
||||||
pub struct ReprFlags: u8 {
|
pub struct ReprFlags: u8 {
|
||||||
const IS_C = 1 << 0;
|
const IS_C = 1 << 0;
|
||||||
const IS_SIMD = 1 << 1;
|
const IS_SIMD = 1 << 1;
|
||||||
|
@ -2076,10 +2065,6 @@ bitflags! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_stable_hash_for!(struct ReprFlags {
|
|
||||||
bits
|
|
||||||
});
|
|
||||||
|
|
||||||
/// Represents the repr options provided by the user,
|
/// Represents the repr options provided by the user,
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable,
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable,
|
||||||
Default, HashStable)]
|
Default, HashStable)]
|
||||||
|
|
|
@ -1204,6 +1204,7 @@ rustc_index::newtype_index! {
|
||||||
/// is the outer fn.
|
/// is the outer fn.
|
||||||
///
|
///
|
||||||
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
|
/// [dbi]: http://en.wikipedia.org/wiki/De_Bruijn_index
|
||||||
|
#[derive(HashStable)]
|
||||||
pub struct DebruijnIndex {
|
pub struct DebruijnIndex {
|
||||||
DEBUG_FORMAT = "DebruijnIndex({})",
|
DEBUG_FORMAT = "DebruijnIndex({})",
|
||||||
const INNERMOST = 0,
|
const INNERMOST = 0,
|
||||||
|
@ -1517,8 +1518,6 @@ impl DebruijnIndex {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_stable_hash_for!(struct DebruijnIndex { private });
|
|
||||||
|
|
||||||
/// Region utilities
|
/// Region utilities
|
||||||
impl RegionKind {
|
impl RegionKind {
|
||||||
/// Is this region named by the user?
|
/// Is this region named by the user?
|
||||||
|
|
Loading…
Reference in New Issue