Closed
Description
With the following input (the a
macro is for showing the behaviour with multiple macros and a different initial formatting) :
pub macro scalar($m: ident, $t: ident) {
pub macro $m {
() => {Val::$t($t::default())},
($v: expr) => {Val::$t($t::new($v))}
}
pub macro a {
() => {
Val::$t($t::default())
},
($v: expr) => {
Val::$t($t::new($v))
}
}
}
A pass of rustfmt adds a level of indentation to the inner macros' bodies, including the closing bracket :
pub macro scalar($m: ident, $t: ident) {
pub macro $m {
() => {Val::$t($t::default())},
($v: expr) => {Val::$t($t::new($v))}
}
pub macro a {
() => {
Val::$t($t::default())
},
($v: expr) => {
Val::$t($t::new($v))
}
}
}
And it keeps adding a level at each run. This also triggers cargo watch.
It seems very similar to #2588 but this one is fixed.
Version rustfmt 1.4.13-nightly (c126730 2020-03-31)
, run within cargo watch with no parameter (cargo watch -x fmt -x run --no-gitignore --clear -q
).