@@ -168,7 +168,7 @@ pub fn rewrite_macro(
168
168
position : MacroPosition ,
169
169
) -> Option < String > {
170
170
let guard = InsideMacroGuard :: inside_macro_context ( context) ;
171
- let result = rewrite_macro_inner ( mac, extra_ident, context, shape, position) ;
171
+ let result = rewrite_macro_inner ( mac, extra_ident, context, shape, position, guard . is_nested ) ;
172
172
if result. is_none ( ) {
173
173
context. macro_rewrite_failure . replace ( true ) ;
174
174
}
@@ -181,6 +181,7 @@ pub fn rewrite_macro_inner(
181
181
context : & RewriteContext ,
182
182
shape : Shape ,
183
183
position : MacroPosition ,
184
+ is_nested_macro : bool ,
184
185
) -> Option < String > {
185
186
if context. config . use_try_shorthand ( ) {
186
187
if let Some ( expr) = convert_try_mac ( mac, context) {
@@ -193,7 +194,7 @@ pub fn rewrite_macro_inner(
193
194
194
195
let macro_name = rewrite_macro_name ( context, & mac. node . path , extra_ident) ;
195
196
196
- let style = if FORCED_BRACKET_MACROS . contains ( & & macro_name[ ..] ) {
197
+ let style = if FORCED_BRACKET_MACROS . contains ( & & macro_name[ ..] ) && !is_nested_macro {
197
198
DelimToken :: Bracket
198
199
} else {
199
200
original_style
@@ -326,7 +327,7 @@ pub fn rewrite_macro_inner(
326
327
} else {
327
328
Some ( SeparatorTactic :: Never )
328
329
} ;
329
- if FORCED_BRACKET_MACROS . contains ( macro_name) {
330
+ if FORCED_BRACKET_MACROS . contains ( macro_name) && !is_nested_macro {
330
331
context. inside_macro . replace ( false ) ;
331
332
if context. use_block_indent ( ) {
332
333
force_trailing_comma = Some ( SeparatorTactic :: Vertical ) ;
0 commit comments