Skip to content

Commit add9ee2

Browse files
committed
Keep lines shorter than 100 characters
1 parent 4eb8d94 commit add9ee2

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ pub struct Frame<'mir, 'tcx: 'mir> {
112112
}
113113

114114
impl<'a, 'mir, 'tcx: 'mir> HashStable<StableHashingContext<'a>> for Frame<'mir, 'tcx> {
115-
fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher<W>) {
115+
fn hash_stable<W: StableHasherResult>(
116+
&self,
117+
hcx: &mut StableHashingContext<'a>,
118+
hasher: &mut StableHasher<W>) {
119+
116120
let Frame {
117121
mir,
118122
instance,
@@ -142,7 +146,10 @@ pub enum StackPopCleanup {
142146
}
143147

144148
impl<'a> HashStable<StableHashingContext<'a>> for StackPopCleanup {
145-
fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'b>, hasher: &mut StableHasher<W>) {
149+
fn hash_stable<W: StableHasherResult>(
150+
&self,
151+
hcx: &mut StableHashingContext<'a>,
152+
hasher: &mut StableHasher<W>) {
146153
match self {
147154
StackPopCleanup::Goto(ref block) => block.hash_stable(hcx, hasher),
148155
StackPopCleanup::None { cleanup } => cleanup.hash_stable(hcx, hasher),

src/librustc_mir/interpret/place.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ pub enum Place<Id=AllocId> {
5959
}
6060

6161
impl<'a> HashStable<StableHashingContext<'a>> for Place {
62-
fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher<W>) {
62+
fn hash_stable<W: StableHasherResult>(
63+
&self, hcx: &mut StableHashingContext<'a>,
64+
hasher: &mut StableHasher<W>) {
65+
6366
match self {
6467
Place::Ptr(mem_place) => mem_place.hash_stable(hcx, hasher),
6568

src/librustc_mir/interpret/snapshot.rs

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ use std::hash::{Hash, Hasher};
22

33
use rustc::ich::{StableHashingContext, StableHashingContextProvider};
44
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+
69
use rustc::ty;
710
use rustc::ty::layout::Align;
811
use rustc_data_structures::indexed_vec::IndexVec;
@@ -29,7 +32,10 @@ macro_rules! __impl_snapshot_field {
2932

3033
macro_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>> {
268278
impl<'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

Comments
 (0)