diff --git a/src/librustc/mir/interpret/value.rs b/src/librustc/mir/interpret/value.rs index d782c4919481..9e54b146fd02 100644 --- a/src/librustc/mir/interpret/value.rs +++ b/src/librustc/mir/interpret/value.rs @@ -84,7 +84,7 @@ impl<'tcx> ConstValue<'tcx> { /// size. Like a range of bytes in an `Allocation`, a `Scalar` can either represent the raw bytes /// of a simple value or a pointer into another `Allocation` #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, RustcEncodable, RustcDecodable, Hash)] -pub enum Scalar { +pub enum Scalar { /// The raw bytes of a simple value. Bits { /// The first `size` bytes are the value. @@ -96,7 +96,7 @@ pub enum Scalar { /// A pointer into an `Allocation`. An `Allocation` in the `memory` module has a list of /// relocations, but a `Scalar` is only large enough to contain one, so we just represent the /// relocation and its associated offset together as a `Pointer` here. - Ptr(Pointer), + Ptr(Pointer), } impl<'tcx> Scalar<()> { diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 995c8a3568a1..b44ed2d0d35b 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -765,7 +765,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> { // SAFE: The above indexing would have panicked if there weren't at least `size` bytes // behind `src` and `dest`. Also, we use the overlapping-safe `ptr::copy` if `src` and // `dest` could possibly overlap. - // The pointers above remain valid even if the `HashMap` table moved around because they + // The pointers above remain valid even if the `HashMap` table is moved around because they // point into the `Vec` storing the bytes. unsafe { assert_eq!(size.bytes() as usize as u64, size.bytes()); diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index 506287f36fa7..039a92cee2ca 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -25,8 +25,8 @@ use rustc::mir::interpret::{ use super::{EvalContext, Machine, MemPlace, MPlaceTy, MemoryKind}; #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, RustcEncodable, RustcDecodable, Hash)] -pub enum ScalarMaybeUndef { - Scalar(Scalar), +pub enum ScalarMaybeUndef { + Scalar(Scalar), Undef, } @@ -147,9 +147,9 @@ impl<'tcx, Tag> ScalarMaybeUndef { /// In particular, thanks to `ScalarPair`, arithmetic operations and casts can be entirely /// defined on `Value`, and do not have to work with a `Place`. #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] -pub enum Value { - Scalar(ScalarMaybeUndef), - ScalarPair(ScalarMaybeUndef, ScalarMaybeUndef), +pub enum Value { + Scalar(ScalarMaybeUndef), + ScalarPair(ScalarMaybeUndef, ScalarMaybeUndef), } impl Value { diff --git a/src/librustc_mir/interpret/snapshot.rs b/src/librustc_mir/interpret/snapshot.rs index 5c1606aec14c..06aee8605c6e 100644 --- a/src/librustc_mir/interpret/snapshot.rs +++ b/src/librustc_mir/interpret/snapshot.rs @@ -110,7 +110,7 @@ macro_rules! impl_snapshot_for { impl<'a, Ctx> self::Snapshot<'a, Ctx> for $enum_name where Ctx: self::SnapshotContext<'a>, { - type Item = $enum_name<(),AllocIdSnapshot<'a>>; + type Item = $enum_name<(), AllocIdSnapshot<'a>>; #[inline] fn snapshot(&self, __ctx: &'a Ctx) -> Self::Item { @@ -131,7 +131,7 @@ macro_rules! impl_snapshot_for { impl<'a, Ctx> self::Snapshot<'a, Ctx> for $struct_name where Ctx: self::SnapshotContext<'a>, { - type Item = $struct_name<(),AllocIdSnapshot<'a>>; + type Item = $struct_name<(), AllocIdSnapshot<'a>>; #[inline] fn snapshot(&self, __ctx: &'a Ctx) -> Self::Item { @@ -183,7 +183,7 @@ impl_snapshot_for!(struct Pointer { impl<'a, Ctx> Snapshot<'a, Ctx> for Scalar where Ctx: SnapshotContext<'a>, { - type Item = Scalar<(),AllocIdSnapshot<'a>>; + type Item = Scalar<(), AllocIdSnapshot<'a>>; fn snapshot(&self, ctx: &'a Ctx) -> Self::Item { match self { @@ -237,7 +237,7 @@ impl<'a> HashStable> for Place { impl<'a, Ctx> Snapshot<'a, Ctx> for Place where Ctx: SnapshotContext<'a>, { - type Item = Place<(),AllocIdSnapshot<'a>>; + type Item = Place<(), AllocIdSnapshot<'a>>; fn snapshot(&self, ctx: &'a Ctx) -> Self::Item { match self { @@ -281,7 +281,7 @@ impl_snapshot_for!(enum LocalValue { impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations where Ctx: SnapshotContext<'a>, { - type Item = Relocations<(),AllocIdSnapshot<'a>>; + type Item = Relocations<(), AllocIdSnapshot<'a>>; fn snapshot(&self, ctx: &'a Ctx) -> Self::Item { Relocations::from_presorted(self.iter() @@ -293,7 +293,7 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations #[derive(Eq, PartialEq)] struct AllocationSnapshot<'a> { bytes: &'a [u8], - relocations: Relocations<(),AllocIdSnapshot<'a>>, + relocations: Relocations<(), AllocIdSnapshot<'a>>, undef_mask: &'a UndefMask, align: &'a Align, mutability: &'a Mutability, @@ -337,8 +337,8 @@ struct FrameSnapshot<'a, 'tcx: 'a> { instance: &'a ty::Instance<'tcx>, span: &'a Span, return_to_block: &'a StackPopCleanup, - return_place: Place<(),AllocIdSnapshot<'a>>, - locals: IndexVec>>, + return_place: Place<(), AllocIdSnapshot<'a>>, + locals: IndexVec>>, block: &'a mir::BasicBlock, stmt: usize, }