Skip to content

Commit a7a5cb6

Browse files
committed
Prefer macro over manual implementation
1 parent 5aa713e commit a7a5cb6

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/librustc_mir/interpret/snapshot.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use std::hash::{Hash, Hasher};
99

10-
use rustc::ich::{StableHashingContextProvider, StableHashingContext};
10+
use rustc::ich::StableHashingContextProvider;
1111
use rustc::mir;
1212
use rustc::mir::interpret::{
1313
AllocId, Pointer, Scalar,
@@ -19,7 +19,7 @@ use rustc::ty::{self, TyCtxt};
1919
use rustc::ty::layout::Align;
2020
use rustc_data_structures::fx::FxHashSet;
2121
use rustc_data_structures::indexed_vec::IndexVec;
22-
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult};
22+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2323
use syntax::ast::Mutability;
2424
use syntax::source_map::Span;
2525

@@ -366,16 +366,10 @@ impl<'a, 'tcx, Ctx> Snapshot<'a, Ctx> for &'a LocalValue<'tcx>
366366
}
367367
}
368368

369-
370-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for LocalValue<'gcx> {
371-
fn hash_stable<W: StableHasherResult>(
372-
&self,
373-
hcx: &mut StableHashingContext<'a>,
374-
hasher: &mut StableHasher<W>,
375-
) {
376-
self.state.hash_stable(hcx, hasher);
377-
}
378-
}
369+
impl_stable_hash_for!(struct LocalValue<'tcx> {
370+
state,
371+
layout -> _,
372+
});
379373

380374
impl<'a, 'b, 'mir, 'tcx: 'a+'mir> SnapshotContext<'b>
381375
for Memory<'a, 'mir, 'tcx, CompileTimeInterpreter<'a, 'mir, 'tcx>>

0 commit comments

Comments
 (0)