Skip to content

Commit e00ebd7

Browse files
committed
Derive HashStable in librustc.
1 parent 618b01f commit e00ebd7

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

src/librustc/ty/mod.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,21 +2081,15 @@ impl_stable_hash_for!(struct ReprFlags {
20812081
});
20822082

20832083
/// Represents the repr options provided by the user,
2084-
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable, Default)]
2084+
#[derive(Copy, Clone, Debug, Eq, PartialEq, RustcEncodable, RustcDecodable,
2085+
Default, HashStable)]
20852086
pub struct ReprOptions {
20862087
pub int: Option<attr::IntType>,
20872088
pub align: Option<Align>,
20882089
pub pack: Option<Align>,
20892090
pub flags: ReprFlags,
20902091
}
20912092

2092-
impl_stable_hash_for!(struct ReprOptions {
2093-
align,
2094-
pack,
2095-
int,
2096-
flags
2097-
});
2098-
20992093
impl ReprOptions {
21002094
pub fn new(tcx: TyCtxt<'_>, did: DefId) -> ReprOptions {
21012095
let mut flags = ReprFlags::empty();
@@ -3439,17 +3433,13 @@ pub struct CrateInherentImpls {
34393433
pub inherent_impls: DefIdMap<Vec<DefId>>,
34403434
}
34413435

3442-
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable)]
3436+
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)]
34433437
pub struct SymbolName {
34443438
// FIXME: we don't rely on interning or equality here - better have
34453439
// this be a `&'tcx str`.
34463440
pub name: Symbol
34473441
}
34483442

3449-
impl_stable_hash_for!(struct self::SymbolName {
3450-
name
3451-
});
3452-
34533443
impl SymbolName {
34543444
pub fn new(name: &str) -> SymbolName {
34553445
SymbolName {

src/librustc/ty/sty.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,21 +1379,20 @@ rustc_index::newtype_index! {
13791379
pub struct BoundVar { .. }
13801380
}
13811381

1382-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
1382+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug,
1383+
RustcEncodable, RustcDecodable, HashStable)]
13831384
pub struct BoundTy {
13841385
pub var: BoundVar,
13851386
pub kind: BoundTyKind,
13861387
}
13871388

1388-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, RustcEncodable, RustcDecodable)]
1389+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug,
1390+
RustcEncodable, RustcDecodable, HashStable)]
13891391
pub enum BoundTyKind {
13901392
Anon,
13911393
Param(Symbol),
13921394
}
13931395

1394-
impl_stable_hash_for!(struct BoundTy { var, kind });
1395-
impl_stable_hash_for!(enum self::BoundTyKind { Anon, Param(a) });
1396-
13971396
impl From<BoundVar> for BoundTy {
13981397
fn from(var: BoundVar) -> Self {
13991398
BoundTy {

0 commit comments

Comments
 (0)