@@ -2,7 +2,10 @@ use std::hash::{Hash, Hasher};
2
2
3
3
use rustc:: ich:: { StableHashingContext , StableHashingContextProvider } ;
4
4
use 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
+
6
9
use rustc:: ty;
7
10
use rustc:: ty:: layout:: Align ;
8
11
use rustc_data_structures:: indexed_vec:: IndexVec ;
@@ -29,7 +32,10 @@ macro_rules! __impl_snapshot_field {
29
32
30
33
macro_rules! impl_snapshot_for {
31
34
// 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
+
33
39
impl <' a, Ctx > self :: Snapshot <' a, Ctx > for $enum_name
34
40
where Ctx : self :: SnapshotContext <' a>,
35
41
{
@@ -40,7 +46,9 @@ macro_rules! impl_snapshot_for {
40
46
match * self {
41
47
$(
42
48
$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
+ ) *
44
52
) *
45
53
}
46
54
}
@@ -165,7 +173,9 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations
165
173
type Item = Relocations < AllocIdSnapshot < ' a > > ;
166
174
167
175
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 ( ) )
169
179
}
170
180
}
171
181
@@ -268,15 +278,20 @@ pub struct EvalSnapshot<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'mir, 'tcx>> {
268
278
impl < ' a , ' mir , ' tcx , M > EvalSnapshot < ' a , ' mir , ' tcx , M >
269
279
where M : Machine < ' mir , ' tcx > ,
270
280
{
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
+
272
286
EvalSnapshot {
273
287
machine : machine. clone ( ) ,
274
288
memory : memory. clone ( ) ,
275
289
stack : stack. into ( ) ,
276
290
}
277
291
}
278
292
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 > > ) {
280
295
let EvalSnapshot { machine, memory, stack } = self ;
281
296
( & machine, memory. snapshot ( ) , stack. iter ( ) . map ( |frame| frame. snapshot ( memory) ) . collect ( ) )
282
297
}
@@ -294,10 +309,15 @@ impl<'a, 'mir, 'tcx, M> Hash for EvalSnapshot<'a, 'mir, 'tcx, M>
294
309
}
295
310
}
296
311
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 >
298
314
where M : Machine < ' mir , ' tcx > ,
299
315
{
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
+
301
321
let EvalSnapshot { machine, memory, stack } = self ;
302
322
( machine, & memory. data , stack) . hash_stable ( hcx, hasher) ;
303
323
}
0 commit comments