File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -502,7 +502,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
502502 ast:: ItemKind :: Static ( ..) | ast:: ItemKind :: Const ( ..) => {
503503 self . visit_static ( & StaticParts :: from_item ( item) ) ;
504504 }
505- ast:: ItemKind :: Fn ( ref fn_signature, ref generics, ref body) => {
505+ ast:: ItemKind :: Fn ( ref fn_signature, ref generics, Some ( ref body) ) => {
506506 let inner_attrs = inner_attributes ( & item. attrs ) ;
507507 let fn_ctxt = match fn_signature. header . ext {
508508 ast:: Extern :: None => visit:: FnCtxt :: Free ,
@@ -514,7 +514,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
514514 item. ident ,
515515 & fn_signature,
516516 & item. vis ,
517- body . as_deref ( ) ,
517+ Some ( body ) ,
518518 ) ,
519519 generics,
520520 & fn_signature. decl ,
@@ -523,6 +523,17 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
523523 Some ( & inner_attrs) ,
524524 )
525525 }
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+ }
526537 ast:: ItemKind :: TyAlias ( ref ty, ref generics) => match ty. kind . opaque_top_hack ( ) {
527538 None => {
528539 let rewrite = rewrite_type_alias (
Original file line number Diff line number Diff line change 1+ // following code is invalid but should not cause an internal error
2+ fn main ( ) {
3+ extern "C" fn packet_records_options_impl_layout_length_encoding_option_len_multiplier ( ) ;
4+ }
You can’t perform that action at this time.
0 commit comments