rust/tests
Yacin Tmimi f2fb3c9659 Update connector search in ControlFlow::rewrite_pat_expr for for loops
Resolves 5009

For loops represented by a ControlFlow object use " in" as their connector.
rustfmt searches for the first uncommented occurrence of the word "in" within the
current span and adjusts it's starting point to look for comments right after that.
visually this looks like this:

    rustfmt starts looking for comments here
            |
            V
    for x in /* ... */ 0..1 {}

This works well in most cases, however when the pattern also contains
the word "in", this leads to issues.

    rustfmt starts looking for comments here
          |
          V
    for in_here in /* ... */ 0..1 {}
        -------
        pattern

In order to correctly identify the connector, the new approach first
updates the span to start after the pattern and then searches for the
first uncommented occurrence of "in".
2021-10-13 19:36:37 -05:00
..
cargo-fmt tests: restructure and extend cargo-fmt tests 2021-09-23 21:12:57 -05:00
config chore: backport 8157a3f0afe978d3e953420577f8344db7e905bf 2020-07-15 09:19:21 -05:00
coverage Replace WriteMode with EmitMode and backup bool 2018-05-21 14:14:09 +12:00
license-template fix: handling of empty str for license template path (#3804) 2019-09-24 09:24:05 +09:00
mod-resolver/issue-4874 fix(rustfmt): load nested out-of-line mods correctly 2021-06-17 22:35:19 -05:00
parser tests: add test for panic on new_parser_from_file 2020-11-02 18:31:51 -06:00
rustfmt Cargo fmt 2019-09-24 09:26:50 +09:00
source Adjust non-empty tuple struct span to start before fields 2021-10-12 20:08:07 -05:00
target Update connector search in ControlFlow::rewrite_pat_expr for for loops 2021-10-13 19:36:37 -05:00
writemode Fix line numbers in checkstyle output (#3694) 2019-08-19 11:11:35 +09:00