File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -229,8 +229,14 @@ fn rewrite_segment(
229229 . chain ( data. bindings . iter ( ) . map ( |x| SegmentParam :: Binding ( & * x) ) )
230230 . collect :: < Vec < _ > > ( ) ;
231231
232- let force_separator =
233- context. inside_macro ( ) && context. snippet ( data. span ) . starts_with ( "::" ) ;
232+ // HACK: squeeze out the span between the identifier and the parameters.
233+ // The hack is requried so that we don't remove the separator inside macro calls.
234+ // This does not work in the presence of comment, hoping that people are
235+ // sane about where to put their comment.
236+ let separator_snippet = context
237+ . snippet ( mk_sp ( segment. ident . span . hi ( ) , data. span . lo ( ) ) )
238+ . trim ( ) ;
239+ let force_separator = context. inside_macro ( ) && separator_snippet. starts_with ( "::" ) ;
234240 let separator = if path_context == PathContext :: Expr || force_separator {
235241 "::"
236242 } else {
You can’t perform that action at this time.
0 commit comments