Fix tidy.
This commit is contained in:
parent
f9ff78bdd5
commit
6b56dced4c
2 changed files with 9 additions and 3 deletions
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue