You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent ICE when formatting braced vec!... (rust-lang#5735)
... when it contains only items.
Fixes 5735
Attemtping to format invocations of macros which are considered "forced
bracket macros" (currently only `vec!`), but are invoked with braces
instead of brackets, and contain only items in their token trees,
currently trigger an ICE in rustfmt. This is because the function that
handles formatting macro invocations containing only items,
`rewrite_macro_with_items`, assumes that the 'new' delimiter style of
the macro being formatted is the same as the delimiter style in the
source text when attempting to locate the span after the macro's opening
delimiter. This leads to the construction of an invalid span, triggering
the ICE.
The fix here is to pass the old delimiter style to
`rewrite_macro_with_items` as well, so that it can successfully locate
the span.
0 commit comments