@@ -102,9 +102,9 @@ pub fn is_const_evaluatable<'cx, 'tcx>(
102102
103103 ControlFlow :: CONTINUE
104104 }
105- Node :: Binop ( _, _, _)
106- | Node :: UnaryOp ( _ , _ )
107- | Node :: FunctionCall ( _ , _ ) => ControlFlow :: CONTINUE ,
105+ Node :: Binop ( _, _, _) | Node :: UnaryOp ( _ , _ ) | Node :: FunctionCall ( _ , _ ) => {
106+ ControlFlow :: CONTINUE
107+ }
108108 } ) ;
109109
110110 match failure_kind {
@@ -348,8 +348,8 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
348348 & ExprKind :: PlaceTypeAscription { source, .. } |
349349 & ExprKind :: ValueTypeAscription { source, .. } => self . recurse_build ( source) ?,
350350
351- // subtle: associated consts are literals this arm handles
352- // `<T as Trait>::ASSOC` as well as `12`
351+ // subtle: associated consts are literals this arm handles
352+ // `<T as Trait>::ASSOC` as well as `12`
353353 & ExprKind :: Literal { literal, .. }
354354 | & ExprKind :: StaticRef { literal, .. } => self . add_node ( Node :: Leaf ( literal) , node. span ) ,
355355
@@ -381,10 +381,10 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
381381 // }
382382 // ```
383383 ExprKind :: Block { body : thir:: Block { stmts : box [ ] , expr : Some ( e) , .. } } => self . recurse_build ( * e) ?,
384- // ExprKind::Use happens when a `hir::ExprKind::Cast` is a
384+ // ExprKind::Use happens when a `hir::ExprKind::Cast` is a
385385 // "coercion cast" i.e. using a coercion or is a no-op.
386386 // this is important so that `N as usize as usize` doesnt unify with `N as usize`
387- & ExprKind :: Use { source}
387+ & ExprKind :: Use { source}
388388 | & ExprKind :: Cast { source } => {
389389 let arg = self . recurse_build ( source) ?;
390390 self . add_node ( Node :: Cast ( arg, node. ty ) , node. span )
@@ -404,7 +404,7 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
404404 | ExprKind :: Field { .. }
405405 | ExprKind :: ConstBlock { .. }
406406 | ExprKind :: Adt ( _) => return self . error (
407- Some ( node. span ) ,
407+ Some ( node. span ) ,
408408 "unsupported operation in generic constant, this may be supported in the future" ,
409409 ) . map ( |never| never) ,
410410
@@ -417,7 +417,7 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
417417 | ExprKind :: Assign { .. }
418418 | ExprKind :: LogicalOp { .. }
419419 | ExprKind :: Unary { .. } //
420- | ExprKind :: Binary { .. } // we handle valid unary/binary ops above
420+ | ExprKind :: Binary { .. } // we handle valid unary/binary ops above
421421 | ExprKind :: Break { .. }
422422 | ExprKind :: Continue { .. }
423423 | ExprKind :: If { .. }
@@ -592,16 +592,14 @@ pub(super) fn try_unify<'tcx>(
592592 && iter:: zip ( a_args, b_args)
593593 . all ( |( & an, & bn) | try_unify ( tcx, a. subtree ( an) , b. subtree ( bn) ) )
594594 }
595- ( Node :: Cast ( a_operand, a_ty) , Node :: Cast ( b_operand, b_ty) )
596- if ( a_ty == b_ty) =>
597- {
595+ ( Node :: Cast ( a_operand, a_ty) , Node :: Cast ( b_operand, b_ty) ) if ( a_ty == b_ty) => {
598596 try_unify ( tcx, a. subtree ( a_operand) , b. subtree ( b_operand) )
599597 }
600598 // use this over `_ => false` to make adding variants to `Node` less error prone
601- ( Node :: Cast ( ..) , _)
602- | ( Node :: FunctionCall ( ..) , _)
603- | ( Node :: UnaryOp ( ..) , _)
604- | ( Node :: Binop ( ..) , _)
599+ ( Node :: Cast ( ..) , _)
600+ | ( Node :: FunctionCall ( ..) , _)
601+ | ( Node :: UnaryOp ( ..) , _)
602+ | ( Node :: Binop ( ..) , _)
605603 | ( Node :: Leaf ( ..) , _) => false ,
606604 }
607605}
0 commit comments