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),
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,
}),
},
) -> 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