File tree 2 files changed +17
-2
lines changed
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> {
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 (
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