Skip to content

Commit ad8deba

Browse files
committed
fix formatting nits
1 parent 5099933 commit ad8deba

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc_mir/interpret/operand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
195195
self.memory.check_align(ptr, ptr_align)?;
196196

197197
if mplace.layout.size.bytes() == 0 {
198-
return Ok(Some(Value::Scalar(ScalarMaybeUndef::Scalar(Scalar::Bits { bits: 0, size: 0 }))));
198+
return Ok(Some(Value::Scalar(Scalar::zst().into())));
199199
}
200200

201201
let ptr = ptr.to_ptr()?;
@@ -228,7 +228,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
228228
/// in a `Value`, not on which data is stored there currently.
229229
pub(super) fn try_read_value(
230230
&self,
231-
src : OpTy<'tcx>,
231+
src: OpTy<'tcx>,
232232
) -> EvalResult<'tcx, Result<Value, MemPlace>> {
233233
Ok(match src.try_as_mplace() {
234234
Ok(mplace) => {
@@ -253,7 +253,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
253253
}
254254

255255
/// Read a scalar from a place
256-
pub fn read_scalar(&self, op : OpTy<'tcx>) -> EvalResult<'tcx, ScalarMaybeUndef> {
256+
pub fn read_scalar(&self, op: OpTy<'tcx>) -> EvalResult<'tcx, ScalarMaybeUndef> {
257257
match *self.read_value(op)? {
258258
Value::ScalarPair(..) => bug!("got ScalarPair for type: {:?}", op.layout.ty),
259259
Value::Scalar(val) => Ok(val),

src/librustc_mir/interpret/place.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
403403
/// Just a convenience function, but used quite a bit.
404404
pub fn place_field(
405405
&mut self,
406-
base : PlaceTy<'tcx>,
406+
base: PlaceTy<'tcx>,
407407
field: u64,
408408
) -> EvalResult<'tcx, PlaceTy<'tcx>> {
409409
// FIXME: We could try to be smarter and avoid allocation for fields that span the
@@ -414,7 +414,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
414414

415415
pub fn place_downcast(
416416
&mut self,
417-
base : PlaceTy<'tcx>,
417+
base: PlaceTy<'tcx>,
418418
variant: usize,
419419
) -> EvalResult<'tcx, PlaceTy<'tcx>> {
420420
// Downcast just changes the layout
@@ -515,7 +515,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
515515
pub fn write_value(
516516
&mut self,
517517
src_val: Value,
518-
dest : PlaceTy<'tcx>,
518+
dest: PlaceTy<'tcx>,
519519
) -> EvalResult<'tcx> {
520520
trace!("write_value: {:?} <- {:?}", *dest, src_val);
521521
// See if we can avoid an allocation. This is the counterpart to `try_read_value`,

src/librustc_mir/interpret/terminator/drop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use rustc::mir::BasicBlock;
22
use rustc::ty::{self, layout::LayoutOf};
33
use syntax::source_map::Span;
44

5-
use rustc::mir::interpret::{EvalResult};
5+
use rustc::mir::interpret::EvalResult;
66
use interpret::{Machine, EvalContext, PlaceTy, PlaceExtra, OpTy, Operand};
77

88
impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {

0 commit comments

Comments
 (0)