about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBruno Dutra <brunocodutra@gmail.com>2018-08-26 19:34:40 +0200
committerBruno Dutra <brunocodutra@gmail.com>2018-09-03 20:02:35 +0200
commitadd9ee24db86ea25a286fbd604f1ba8aadf90969 (patch)
tree7e8671f3634aeb12bf7899be32acbae8d7a39ee8 /src
parent4eb8d94cd99856f44c24e65b8ebc7ce3bde9a4ea (diff)
downloadrust-add9ee24db86ea25a286fbd604f1ba8aadf90969.tar.gz
rust-add9ee24db86ea25a286fbd604f1ba8aadf90969.zip
Keep lines shorter than 100 characters
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/interpret/eval_context.rs11
-rw-r--r--src/librustc_mir/interpret/place.rs5
-rw-r--r--src/librustc_mir/interpret/snapshot.rs36
3 files changed, 41 insertions, 11 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs
index de76064b7cd..ac34de490bb 100644
--- a/src/librustc_mir/interpret/eval_context.rs
+++ b/src/librustc_mir/interpret/eval_context.rs
@@ -112,7 +112,11 @@ pub struct Frame<'mir, 'tcx: 'mir> {
 }
 
 impl<'a, 'mir, 'tcx: 'mir> HashStable<StableHashingContext<'a>> for Frame<'mir, 'tcx> {
-    fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher<W>) {
+    fn hash_stable<W: StableHasherResult>(
+        &self,
+        hcx: &mut StableHashingContext<'a>,
+        hasher: &mut StableHasher<W>) {
+
         let Frame {
             mir,
             instance,
@@ -142,7 +146,10 @@ pub enum StackPopCleanup {
 }
 
 impl<'a> HashStable<StableHashingContext<'a>> for StackPopCleanup {
-    fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'b>, hasher: &mut StableHasher<W>) {
+    fn hash_stable<W: StableHasherResult>(
+        &self,
+        hcx: &mut StableHashingContext<'a>,
+        hasher: &mut StableHasher<W>) {
         match self {
             StackPopCleanup::Goto(ref block) => block.hash_stable(hcx, hasher),
             StackPopCleanup::None { cleanup } => cleanup.hash_stable(hcx, hasher),
diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs
index fd7324c2d17..0d165ef4803 100644
--- a/src/librustc_mir/interpret/place.rs
+++ b/src/librustc_mir/interpret/place.rs
@@ -59,7 +59,10 @@ pub enum Place<Id=AllocId> {
 }
 
 impl<'a> HashStable<StableHashingContext<'a>> for Place {
-    fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher<W>) {
+    fn hash_stable<W: StableHasherResult>(
+        &self, hcx: &mut StableHashingContext<'a>,
+        hasher: &mut StableHasher<W>) {
+
         match self {
             Place::Ptr(mem_place) => mem_place.hash_stable(hcx, hasher),
 
diff --git a/src/librustc_mir/interpret/snapshot.rs b/src/librustc_mir/interpret/snapshot.rs
index 02b3c696e1f..72cc6220470 100644
--- a/src/librustc_mir/interpret/snapshot.rs
+++ b/src/librustc_mir/interpret/snapshot.rs
@@ -2,7 +2,10 @@ use std::hash::{Hash, Hasher};
 
 use rustc::ich::{StableHashingContext, StableHashingContextProvider};
 use rustc::mir;
-use rustc::mir::interpret::{AllocId, Pointer, Scalar, ScalarMaybeUndef, Relocations, Allocation, UndefMask};
+use rustc::mir::interpret::{
+    AllocId, Pointer, Scalar, ScalarMaybeUndef, Relocations, Allocation, UndefMask
+};
+
 use rustc::ty;
 use rustc::ty::layout::Align;
 use rustc_data_structures::indexed_vec::IndexVec;
@@ -29,7 +32,10 @@ macro_rules! __impl_snapshot_field {
 
 macro_rules! impl_snapshot_for {
     // FIXME(mark-i-m): Some of these should be `?` rather than `*`.
-    (enum $enum_name:ident { $( $variant:ident $( ( $($field:ident $(-> $delegate:expr)*),* ) )* ),* $(,)* }) => {
+    (enum $enum_name:ident {
+        $( $variant:ident $( ( $($field:ident $(-> $delegate:expr)*),* ) )* ),* $(,)*
+    }) => {
+
         impl<'a, Ctx> self::Snapshot<'a, Ctx> for $enum_name
             where Ctx: self::SnapshotContext<'a>,
         {
@@ -40,7 +46,9 @@ macro_rules! impl_snapshot_for {
                 match *self {
                     $(
                         $enum_name::$variant $( ( $(ref $field),* ) )* =>
-                            $enum_name::$variant $( ( $( __impl_snapshot_field!($field, __ctx $(, $delegate)*) ),* ), )*
+                            $enum_name::$variant $(
+                                ( $( __impl_snapshot_field!($field, __ctx $(, $delegate)*) ),* ),
+                            )*
                     )*
                 }
             }
@@ -165,7 +173,9 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations
     type Item = Relocations<AllocIdSnapshot<'a>>;
 
     fn snapshot(&self, ctx: &'a Ctx) -> Self::Item {
-        Relocations::from_presorted(self.iter().map(|(size, id)| (*size, id.snapshot(ctx))).collect())
+        Relocations::from_presorted(self.iter()
+            .map(|(size, id)| (*size, id.snapshot(ctx)))
+            .collect())
     }
 }
 
@@ -268,7 +278,11 @@ pub struct EvalSnapshot<'a, 'mir, 'tcx: 'a + 'mir, M: Machine<'mir, 'tcx>> {
 impl<'a, 'mir, 'tcx, M> EvalSnapshot<'a, 'mir, 'tcx, M>
     where M: Machine<'mir, 'tcx>,
 {
-    pub fn new(machine: &M, memory: &Memory<'a, 'mir, 'tcx, M>, stack: &[Frame<'mir, 'tcx>]) -> Self {
+    pub fn new(
+        machine: &M,
+        memory: &Memory<'a, 'mir, 'tcx, M>,
+        stack: &[Frame<'mir, 'tcx>]) -> Self {
+
         EvalSnapshot {
             machine: machine.clone(),
             memory: memory.clone(),
@@ -276,7 +290,8 @@ impl<'a, 'mir, 'tcx, M> EvalSnapshot<'a, 'mir, 'tcx, M>
         }
     }
 
-    fn snapshot<'b: 'a>(&'b self) -> (&'b M, MemorySnapshot<'b, 'mir, 'tcx, M>, Vec<FrameSnapshot<'a, 'tcx>>) {
+    fn snapshot<'b: 'a>(&'b self)
+        -> (&'b M, MemorySnapshot<'b, 'mir, 'tcx, M>, Vec<FrameSnapshot<'a, 'tcx>>) {
         let EvalSnapshot{ machine, memory, stack } = self;
         (&machine, memory.snapshot(), stack.iter().map(|frame| frame.snapshot(memory)).collect())
     }
@@ -294,10 +309,15 @@ impl<'a, 'mir, 'tcx, M> Hash for EvalSnapshot<'a, 'mir, 'tcx, M>
     }
 }
 
-impl<'a, 'b, 'mir, 'tcx, M> HashStable<StableHashingContext<'b>> for EvalSnapshot<'a, 'mir, 'tcx, M>
+impl<'a, 'b, 'mir, 'tcx, M> HashStable<StableHashingContext<'b>>
+    for EvalSnapshot<'a, 'mir, 'tcx, M>
     where M: Machine<'mir, 'tcx>,
 {
-    fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHashingContext<'b>, hasher: &mut StableHasher<W>) {
+    fn hash_stable<W: StableHasherResult>(
+        &self,
+        hcx: &mut StableHashingContext<'b>,
+        hasher: &mut StableHasher<W>) {
+
         let EvalSnapshot{ machine, memory, stack } = self;
         (machine, &memory.data, stack).hash_stable(hcx, hasher);
     }