diff options
| -rw-r--r-- | src/librustc_codegen_ssa/mir/place.rs | 4 | ||||
| -rw-r--r-- | src/librustc_mir/hair/pattern/_match.rs | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/librustc_codegen_ssa/mir/place.rs b/src/librustc_codegen_ssa/mir/place.rs index d515f114c77..d4e33ee8b6f 100644 --- a/src/librustc_codegen_ssa/mir/place.rs +++ b/src/librustc_codegen_ssa/mir/place.rs @@ -480,7 +480,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let layout = cx.layout_of(self.monomorphize(&ty)); match bx.tcx().const_eval(param_env.and(cid)) { Ok(val) => match val.val { - ty::ConstKind::Value(mir::interpret::ConstValue::ByRef { alloc, offset }) => { + ty::ConstKind::Value(mir::interpret::ConstValue::ByRef { + alloc, offset + }) => { bx.cx().from_const_alloc(layout, alloc, offset) } _ => bug!("promoteds should have an allocation: {:?}", val), diff --git a/src/librustc_mir/hair/pattern/_match.rs b/src/librustc_mir/hair/pattern/_match.rs index 9a1fbf71e6f..9894fa64779 100644 --- a/src/librustc_mir/hair/pattern/_match.rs +++ b/src/librustc_mir/hair/pattern/_match.rs @@ -327,7 +327,9 @@ impl PatternFolder<'tcx> for LiteralExpander<'tcx> { span: pat.span, kind: box PatKind::Constant { value: self.tcx.mk_const(Const { - val: ty::ConstKind::Value(self.fold_const_value_deref(*val, rty, crty)), + val: ty::ConstKind::Value( + self.fold_const_value_deref(*val, rty, crty) + ), ty: rty, }), }, @@ -1256,7 +1258,9 @@ impl<'tcx> IntRange<'tcx> { ) -> Option<IntRange<'tcx>> { if let Some((target_size, bias)) = Self::integral_size_and_signed_bias(tcx, value.ty) { let ty = value.ty; - let val = if let ty::ConstKind::Value(ConstValue::Scalar(Scalar::Raw { data, size })) = value.val { + let val = if let ty::ConstKind::Value(ConstValue::Scalar( + Scalar::Raw { data, size } + )) = value.val { // For this specific pattern we can skip a lot of effort and go // straight to the result, after doing a bit of checking. (We // could remove this branch and just use the next branch, which |
