@@ -2,7 +2,10 @@ use std::hash::{Hash, Hasher};
22
33use rustc:: ich:: { StableHashingContext , StableHashingContextProvider } ;
44use rustc:: mir;
5- use rustc:: mir:: interpret:: { AllocId , Pointer , Scalar , ScalarMaybeUndef , Relocations , Allocation , UndefMask } ;
5+ use rustc:: mir:: interpret:: {
6+ AllocId , Pointer , Scalar , ScalarMaybeUndef , Relocations , Allocation , UndefMask
7+ } ;
8+
69use rustc:: ty;
710use rustc:: ty:: layout:: Align ;
811use rustc_data_structures:: indexed_vec:: IndexVec ;
@@ -29,7 +32,10 @@ macro_rules! __impl_snapshot_field {
2932
3033macro_rules! impl_snapshot_for {
3134 // FIXME(mark-i-m): Some of these should be `?` rather than `*`.
32- ( enum $enum_name: ident { $( $variant: ident $( ( $( $field: ident $( -> $delegate: expr) * ) ,* ) ) * ) ,* $( , ) * } ) => {
35+ ( enum $enum_name: ident {
36+ $( $variant: ident $( ( $( $field: ident $( -> $delegate: expr) * ) ,* ) ) * ) ,* $( , ) *
37+ } ) => {
38+
3339 impl <' a, Ctx > self :: Snapshot <' a, Ctx > for $enum_name
3440 where Ctx : self :: SnapshotContext <' a>,
3541 {
@@ -40,7 +46,9 @@ macro_rules! impl_snapshot_for {
4046 match * self {
4147 $(
4248 $enum_name:: $variant $( ( $( ref $field) ,* ) ) * =>
43- $enum_name:: $variant $( ( $( __impl_snapshot_field!( $field, __ctx $( , $delegate) * ) ) ,* ) , ) *
49+ $enum_name:: $variant $(
50+ ( $( __impl_snapshot_field!( $field, __ctx $( , $delegate) * ) ) ,* ) ,
51+ ) *
4452 ) *
4553 }
4654 }
@@ -165,7 +173,9 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations
165173 type Item = Relocations < AllocIdSnapshot < ' a > > ;
166174
167175 fn snapshot ( & self , ctx : & ' a Ctx ) -> Self :: Item {
168- Relocations :: from_presorted ( self . iter ( ) . map ( |( size, id) | ( * size, id. snapshot ( ctx) ) ) . collect ( ) )
176+ Relocations :: from_presorted ( self . iter ( )
177+ . map ( |( size, id) | ( * size, id. snapshot ( ctx) ) )
178+ . collect ( ) )
169179 }
170180}
171181
@@ -268,15 +278,20 @@ pub struct EvalSnapshot<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'mir, 'tcx>> {
268278impl < ' a , ' mir , ' tcx , M > EvalSnapshot < ' a , ' mir , ' tcx , M >
269279 where M : Machine < ' mir , ' tcx > ,
270280{
271- pub fn new ( machine : & M , memory : & Memory < ' a , ' mir , ' tcx , M > , stack : & [ Frame < ' mir , ' tcx > ] ) -> Self {
281+ pub fn new (
282+ machine : & M ,
283+ memory : & Memory < ' a , ' mir , ' tcx , M > ,
284+ stack : & [ Frame < ' mir , ' tcx > ] ) -> Self {
285+
272286 EvalSnapshot {
273287 machine : machine. clone ( ) ,
274288 memory : memory. clone ( ) ,
275289 stack : stack. into ( ) ,
276290 }
277291 }
278292
279- fn snapshot < ' b : ' a > ( & ' b self ) -> ( & ' b M , MemorySnapshot < ' b , ' mir , ' tcx , M > , Vec < FrameSnapshot < ' a , ' tcx > > ) {
293+ fn snapshot < ' b : ' a > ( & ' b self )
294+ -> ( & ' b M , MemorySnapshot < ' b , ' mir , ' tcx , M > , Vec < FrameSnapshot < ' a , ' tcx > > ) {
280295 let EvalSnapshot { machine, memory, stack } = self ;
281296 ( & machine, memory. snapshot ( ) , stack. iter ( ) . map ( |frame| frame. snapshot ( memory) ) . collect ( ) )
282297 }
@@ -294,10 +309,15 @@ impl<'a, 'mir, 'tcx, M> Hash for EvalSnapshot<'a, 'mir, 'tcx, M>
294309 }
295310}
296311
297- impl < ' a , ' b , ' mir , ' tcx , M > HashStable < StableHashingContext < ' b > > for EvalSnapshot < ' a , ' mir , ' tcx , M >
312+ impl < ' a , ' b , ' mir , ' tcx , M > HashStable < StableHashingContext < ' b > >
313+ for EvalSnapshot < ' a , ' mir , ' tcx , M >
298314 where M : Machine < ' mir , ' tcx > ,
299315{
300- fn hash_stable < W : StableHasherResult > ( & self , hcx : & mut StableHashingContext < ' b > , hasher : & mut StableHasher < W > ) {
316+ fn hash_stable < W : StableHasherResult > (
317+ & self ,
318+ hcx : & mut StableHashingContext < ' b > ,
319+ hasher : & mut StableHasher < W > ) {
320+
301321 let EvalSnapshot { machine, memory, stack } = self ;
302322 ( machine, & memory. data , stack) . hash_stable ( hcx, hasher) ;
303323 }
0 commit comments