@@ -364,7 +364,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
364
364
mk_sp ( s. lo ( ) , b. span . lo ( ) ) ,
365
365
)
366
366
}
367
- _ => return ,
367
+ _ => unreachable ! ( ) ,
368
368
} ;
369
369
370
370
if let Some ( ( fn_str, fn_brace_style) ) = rewrite {
@@ -502,7 +502,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
502
502
ast:: ItemKind :: Static ( ..) | ast:: ItemKind :: Const ( ..) => {
503
503
self . visit_static ( & StaticParts :: from_item ( item) ) ;
504
504
}
505
- ast:: ItemKind :: Fn ( ref fn_signature, ref generics, ref body) => {
505
+ ast:: ItemKind :: Fn ( ref fn_signature, ref generics, Some ( ref body) ) => {
506
506
let inner_attrs = inner_attributes ( & item. attrs ) ;
507
507
let fn_ctxt = match fn_signature. header . ext {
508
508
ast:: Extern :: None => visit:: FnCtxt :: Free ,
@@ -514,7 +514,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
514
514
item. ident ,
515
515
& fn_signature,
516
516
& item. vis ,
517
- body . as_deref ( ) ,
517
+ Some ( body ) ,
518
518
) ,
519
519
generics,
520
520
& fn_signature. decl ,
@@ -523,6 +523,17 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
523
523
Some ( & inner_attrs) ,
524
524
)
525
525
}
526
+ ast:: ItemKind :: Fn ( ref fn_signature, ref generics, None ) => {
527
+ let indent = self . block_indent ;
528
+ let rewrite = self . rewrite_required_fn (
529
+ indent,
530
+ item. ident ,
531
+ & fn_signature,
532
+ generics,
533
+ item. span ,
534
+ ) ;
535
+ self . push_rewrite ( item. span , rewrite) ;
536
+ }
526
537
ast:: ItemKind :: TyAlias ( ref ty, ref generics) => match ty. kind . opaque_top_hack ( ) {
527
538
None => {
528
539
let rewrite = rewrite_type_alias (
0 commit comments