@@ -76,7 +76,9 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
76
76
kind : hir:: TraitItemKind :: Const ( ty, Some ( body_id) ) ,
77
77
..
78
78
} ) => ( * body_id, ty. span , None ) ,
79
- Node :: AnonConst ( hir:: AnonConst { body, hir_id, .. } ) => ( * body, tcx. hir ( ) . span ( * hir_id) , None ) ,
79
+ Node :: AnonConst ( hir:: AnonConst { body, hir_id, .. } ) => {
80
+ ( * body, tcx. hir ( ) . span ( * hir_id) , None )
81
+ }
80
82
81
83
_ => span_bug ! ( tcx. hir( ) . span( id) , "can't build MIR for {:?}" , def. did) ,
82
84
} ;
@@ -184,7 +186,7 @@ fn mir_build(tcx: TyCtxt<'_>, def: ty::WithOptConstParam<LocalDefId>) -> Body<'_
184
186
return_ty,
185
187
return_ty_span,
186
188
body,
187
- span_with_body
189
+ span_with_body,
188
190
) ;
189
191
mir. yield_ty = yield_ty;
190
192
mir
@@ -582,7 +584,7 @@ fn construct_fn<'a, 'tcx, A>(
582
584
return_ty : Ty < ' tcx > ,
583
585
return_ty_span : Span ,
584
586
body : & ' tcx hir:: Body < ' tcx > ,
585
- span_with_body : Span
587
+ span_with_body : Span ,
586
588
) -> Body < ' tcx >
587
589
where
588
590
A : Iterator < Item = ArgInfo < ' tcx > > ,
@@ -658,7 +660,8 @@ fn construct_const<'a, 'tcx>(
658
660
let owner_id = tcx. hir ( ) . body_owner ( body_id) ;
659
661
let def_id = tcx. hir ( ) . local_def_id ( owner_id) ;
660
662
let span = tcx. hir ( ) . span ( owner_id) ;
661
- let mut builder = Builder :: new ( hir, def_id. to_def_id ( ) , span, 0 , Safety :: Safe , const_ty, const_ty_span, None ) ;
663
+ let mut builder =
664
+ Builder :: new ( hir, def_id. to_def_id ( ) , span, 0 , Safety :: Safe , const_ty, const_ty_span, None ) ;
662
665
663
666
let mut block = START_BLOCK ;
664
667
let ast_expr = & tcx. hir ( ) . body ( body_id) . value ;
@@ -698,7 +701,8 @@ fn construct_error<'a, 'tcx>(hir: Cx<'a, 'tcx>, body_id: hir::BodyId) -> Body<'t
698
701
hir:: BodyOwnerKind :: Const => 0 ,
699
702
hir:: BodyOwnerKind :: Static ( _) => 0 ,
700
703
} ;
701
- let mut builder = Builder :: new ( hir, def_id. to_def_id ( ) , span, num_params, Safety :: Safe , ty, span, None ) ;
704
+ let mut builder =
705
+ Builder :: new ( hir, def_id. to_def_id ( ) , span, num_params, Safety :: Safe , ty, span, None ) ;
702
706
let source_info = builder. source_info ( span) ;
703
707
// Some MIR passes will expect the number of parameters to match the
704
708
// function declaration.
0 commit comments