File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1771,12 +1771,18 @@ fn rewrite_fn_base(
1771
1771
result. push ( ' ' )
1772
1772
}
1773
1773
1774
+ // Skip `pub(crate)`.
1775
+ let lo_after_visibility = if let ast:: Visibility :: Crate ( s) = fn_sig. visibility {
1776
+ context. codemap . span_after ( mk_sp ( s. hi ( ) , span. hi ( ) ) , ")" )
1777
+ } else {
1778
+ span. lo ( )
1779
+ } ;
1774
1780
// A conservative estimation, to goal is to be over all parens in generics
1775
1781
let args_start = fn_sig
1776
1782
. generics
1777
1783
. ty_params
1778
1784
. last ( )
1779
- . map_or ( span . lo ( ) , |tp| end_typaram ( tp) ) ;
1785
+ . map_or ( lo_after_visibility , |tp| end_typaram ( tp) ) ;
1780
1786
let args_end = if fd. inputs . is_empty ( ) {
1781
1787
context
1782
1788
. codemap
Original file line number Diff line number Diff line change @@ -59,3 +59,6 @@ mod foo {
59
59
foo ( ) ;
60
60
}
61
61
}
62
+
63
+ // #2082
64
+ pub ( crate ) fn init ( ) { }
Original file line number Diff line number Diff line change @@ -101,3 +101,6 @@ mod foo {
101
101
foo ( ) ;
102
102
}
103
103
}
104
+
105
+ // #2082
106
+ pub ( crate ) fn init ( ) { }
You can’t perform that action at this time.
0 commit comments