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
rustfmt is not idempotent over some blocks that consist of a series of empty statements finished by an expression. The first pass strips the empty statements and the second pass applies any applicable transformation to the block such as unwrapping the expression in it or rearranging it into a single line.
To Reproduce
Example input:
fnfoo(x:Option<i32>) -> i32{let y = {;
x
};match y {Some(y) => {;;
y
}None => 0,}}
Calling rustfmt once results in
fnfoo(x:Option<i32>) -> i32{let y = {
x
};match y {Some(y) => {
y
}None => 0,}}
Calling rustfmt on the previous output then results in
fnfoo(x:Option<i32>) -> i32{let y = { x };match y {Some(y) => y,None => 0,}}
Expected behavior
rustfmt should return the output of the second pass in the first pass.