Closed
Description
If the subset of a variable name is "in" inside of the for-loop's for ... in
section and requires formatting with a comment around the in-keyword, an invalid output is produced.
For this input:
fn main() {
for variable_in_here /* ... */ in 0..1 {}
for variable_in_here in /* ... */ 0..1 {}
for variable_in_here
in /* ... */ 0..1 {}
for variable_in_here
/* ... */ in 0..1 {}
}
The output becomes invalid syntax:
fn main() {
for variable_in_here in _here /* ... */ in 0..1 {}
for variable_in_here in _here in /* ... */ 0..1 {}
for variable_in_here in
_here
in /* ... */
0..1
{}
for variable_in_here in
_here
/* ... */ in
0..1
{}
}
If the characters "in" are removed from the input, the output will remain valid syntax:
fn main() {
for variable__here /* ... */ in 0..1 {}
for variable__here in /* ... */ 0..1 {}
for variable__here in /* ... */ 0..1 {}
for variable__here
/* ... */ in 0..1 {}
}
$ rustfmt --version
rustfmt 1.4.37-stable (a178d03 2021-07-26)