rust/tests
Yacin Tmimi f7c4a44149 Adjust non-empty tuple struct span to start before fields
Resolves 5011

Tuple structs with visibility modifiers and comments before the first
field were incorrectly formatted. Comments would duplicate part of the
visibility modifier and struct name.

When trying to parse the tuple fields the ``items::Context`` searches
for the opening '(', but because the visibility modifier introduces
another '(' -- for example ``pub(crate)`` -- the parsing gets messed up.

Now the span is adjusted to start after the struct identifier, or after
any generics. Adjusting the span in this way ensures that the
``items::Contex`` will correctly find the tuple fields.
2021-10-12 20:08:07 -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
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 Adjust non-empty tuple struct span to start before fields 2021-10-12 20:08:07 -05:00
writemode Fix line numbers in checkstyle output (#3694) 2019-08-19 11:11:35 +09:00