]> git.lizzy.rs Git - rust.git/commitdiff
Moving config option tests to subdirectory
authorDavid Alber <alber.david@gmail.com>
Thu, 28 Dec 2017 06:44:30 +0000 (22:44 -0800)
committerDavid Alber <alber.david@gmail.com>
Thu, 28 Dec 2017 18:29:48 +0000 (10:29 -0800)
This was done by running the following.

```sh
for f in `find . -name "configs-*.rs"`; do
    topdir=`echo $f | cut -d/ -f2`;
    configname=`echo $f | cut -d/ -f3 | cut -d- -f2`;
    testname=`echo $f | cut -d/ -f3 | cut -d- -f3`;
    mkdir -p $topdir/configs/$configname;
    git mv $f $topdir/configs/$configname/$testname;
done
```

360 files changed:
tests/source/configs-array_indent-block.rs [deleted file]
tests/source/configs-array_indent-visual.rs [deleted file]
tests/source/configs-blank_lines_lower_bound-1.rs [deleted file]
tests/source/configs-chain_indent-block.rs [deleted file]
tests/source/configs-chain_indent-visual.rs [deleted file]
tests/source/configs-comment_width-above.rs [deleted file]
tests/source/configs-comment_width-below.rs [deleted file]
tests/source/configs-comment_width-ignore.rs [deleted file]
tests/source/configs-condense_wildcard_suffices-false.rs [deleted file]
tests/source/configs-condense_wildcard_suffices-true.rs [deleted file]
tests/source/configs-control_brace_style-always_next_line.rs [deleted file]
tests/source/configs-control_brace_style-always_same_line.rs [deleted file]
tests/source/configs-control_brace_style-closing_next_line.rs [deleted file]
tests/source/configs-disable_all_formatting-false.rs [deleted file]
tests/source/configs-disable_all_formatting-true.rs [deleted file]
tests/source/configs-empty_item_single_line-false.rs [deleted file]
tests/source/configs-empty_item_single_line-true.rs [deleted file]
tests/source/configs-error_on_line_overflow-false.rs [deleted file]
tests/source/configs-fn_args_density-compressed.rs [deleted file]
tests/source/configs-fn_args_density-tall.rs [deleted file]
tests/source/configs-fn_args_density-vertical.rs [deleted file]
tests/source/configs-fn_args_indent-block.rs [deleted file]
tests/source/configs-fn_args_indent-visual.rs [deleted file]
tests/source/configs-fn_brace_style-always_next_line.rs [deleted file]
tests/source/configs-fn_brace_style-prefer_same_line.rs [deleted file]
tests/source/configs-fn_brace_style-same_line_where.rs [deleted file]
tests/source/configs-fn_call_indent-block.rs [deleted file]
tests/source/configs-fn_call_indent-block_trailing_comma.rs [deleted file]
tests/source/configs-fn_call_indent-visual.rs [deleted file]
tests/source/configs-fn_call_indent-visual_trailing_comma.rs [deleted file]
tests/source/configs-fn_single_line-false.rs [deleted file]
tests/source/configs-fn_single_line-true.rs [deleted file]
tests/source/configs-force_explicit_abi-false.rs [deleted file]
tests/source/configs-force_explicit_abi-true.rs [deleted file]
tests/source/configs-force_multiline_block-false.rs [deleted file]
tests/source/configs-force_multiline_block-true.rs [deleted file]
tests/source/configs-format_strings-false.rs [deleted file]
tests/source/configs-format_strings-true.rs [deleted file]
tests/source/configs-generics_indent-block.rs [deleted file]
tests/source/configs-generics_indent-visual.rs [deleted file]
tests/source/configs-hard_tabs-false.rs [deleted file]
tests/source/configs-hard_tabs-true.rs [deleted file]
tests/source/configs-item_brace_style-always_next_line.rs [deleted file]
tests/source/configs-item_brace_style-prefer_same_line.rs [deleted file]
tests/source/configs-item_brace_style-same_line_where.rs [deleted file]
tests/source/configs-match_arm_blocks-false.rs [deleted file]
tests/source/configs-match_arm_blocks-true.rs [deleted file]
tests/source/configs-match_block_trailing_comma-false.rs [deleted file]
tests/source/configs-match_block_trailing_comma-true.rs [deleted file]
tests/source/configs-merge_derives-true.rs [deleted file]
tests/source/configs-normalize_comments-false.rs [deleted file]
tests/source/configs-normalize_comments-true.rs [deleted file]
tests/source/configs-reorder_imported_names-false.rs [deleted file]
tests/source/configs-reorder_imported_names-true.rs [deleted file]
tests/source/configs-reorder_imports-false.rs [deleted file]
tests/source/configs-reorder_imports-true.rs [deleted file]
tests/source/configs-reorder_imports_in_group-false.rs [deleted file]
tests/source/configs-reorder_imports_in_group-true.rs [deleted file]
tests/source/configs-same_line_attributes-false.rs [deleted file]
tests/source/configs-same_line_attributes-true.rs [deleted file]
tests/source/configs-space_before_colon-true.rs [deleted file]
tests/source/configs-spaces_around_ranges-false.rs [deleted file]
tests/source/configs-spaces_around_ranges-true.rs [deleted file]
tests/source/configs-spaces_within_parens_and_brackets-false.rs [deleted file]
tests/source/configs-spaces_within_parens_and_brackets-true.rs [deleted file]
tests/source/configs-struct_field_align_threshold-20.rs [deleted file]
tests/source/configs-struct_lit_indent-block.rs [deleted file]
tests/source/configs-struct_lit_indent-visual.rs [deleted file]
tests/source/configs-struct_lit_single_line-false.rs [deleted file]
tests/source/configs-tab_spaces-2.rs [deleted file]
tests/source/configs-tab_spaces-4.rs [deleted file]
tests/source/configs-trailing_comma-always.rs [deleted file]
tests/source/configs-trailing_comma-never.rs [deleted file]
tests/source/configs-trailing_comma-vertical.rs [deleted file]
tests/source/configs-type_punctuation_density-compressed.rs [deleted file]
tests/source/configs-type_punctuation_density-wide.rs [deleted file]
tests/source/configs-use_try_shorthand-false.rs [deleted file]
tests/source/configs-use_try_shorthand-true.rs [deleted file]
tests/source/configs-where_pred_indent-block.rs [deleted file]
tests/source/configs-where_pred_indent-visual.rs [deleted file]
tests/source/configs-where_single_line-true.rs [deleted file]
tests/source/configs-where_style-default.rs [deleted file]
tests/source/configs-where_style-rfc.rs [deleted file]
tests/source/configs-wrap_comments-false.rs [deleted file]
tests/source/configs-wrap_comments-true.rs [deleted file]
tests/source/configs/array_indent/block.rs [new file with mode: 0644]
tests/source/configs/array_indent/visual.rs [new file with mode: 0644]
tests/source/configs/blank_lines_lower_bound/1.rs [new file with mode: 0644]
tests/source/configs/chain_indent/block.rs [new file with mode: 0644]
tests/source/configs/chain_indent/visual.rs [new file with mode: 0644]
tests/source/configs/comment_width/above.rs [new file with mode: 0644]
tests/source/configs/comment_width/below.rs [new file with mode: 0644]
tests/source/configs/comment_width/ignore.rs [new file with mode: 0644]
tests/source/configs/condense_wildcard_suffices/false.rs [new file with mode: 0644]
tests/source/configs/condense_wildcard_suffices/true.rs [new file with mode: 0644]
tests/source/configs/control_brace_style/always_next_line.rs [new file with mode: 0644]
tests/source/configs/control_brace_style/always_same_line.rs [new file with mode: 0644]
tests/source/configs/control_brace_style/closing_next_line.rs [new file with mode: 0644]
tests/source/configs/disable_all_formatting/false.rs [new file with mode: 0644]
tests/source/configs/disable_all_formatting/true.rs [new file with mode: 0644]
tests/source/configs/empty_item_single_line/false.rs [new file with mode: 0644]
tests/source/configs/empty_item_single_line/true.rs [new file with mode: 0644]
tests/source/configs/error_on_line_overflow/false.rs [new file with mode: 0644]
tests/source/configs/fn_args_density/compressed.rs [new file with mode: 0644]
tests/source/configs/fn_args_density/tall.rs [new file with mode: 0644]
tests/source/configs/fn_args_density/vertical.rs [new file with mode: 0644]
tests/source/configs/fn_args_indent/block.rs [new file with mode: 0644]
tests/source/configs/fn_args_indent/visual.rs [new file with mode: 0644]
tests/source/configs/fn_brace_style/always_next_line.rs [new file with mode: 0644]
tests/source/configs/fn_brace_style/prefer_same_line.rs [new file with mode: 0644]
tests/source/configs/fn_brace_style/same_line_where.rs [new file with mode: 0644]
tests/source/configs/fn_call_indent/block.rs [new file with mode: 0644]
tests/source/configs/fn_call_indent/block_trailing_comma.rs [new file with mode: 0644]
tests/source/configs/fn_call_indent/visual.rs [new file with mode: 0644]
tests/source/configs/fn_call_indent/visual_trailing_comma.rs [new file with mode: 0644]
tests/source/configs/fn_single_line/false.rs [new file with mode: 0644]
tests/source/configs/fn_single_line/true.rs [new file with mode: 0644]
tests/source/configs/force_explicit_abi/false.rs [new file with mode: 0644]
tests/source/configs/force_explicit_abi/true.rs [new file with mode: 0644]
tests/source/configs/force_multiline_block/false.rs [new file with mode: 0644]
tests/source/configs/force_multiline_block/true.rs [new file with mode: 0644]
tests/source/configs/format_strings/false.rs [new file with mode: 0644]
tests/source/configs/format_strings/true.rs [new file with mode: 0644]
tests/source/configs/generics_indent/block.rs [new file with mode: 0644]
tests/source/configs/generics_indent/visual.rs [new file with mode: 0644]
tests/source/configs/hard_tabs/false.rs [new file with mode: 0644]
tests/source/configs/hard_tabs/true.rs [new file with mode: 0644]
tests/source/configs/item_brace_style/always_next_line.rs [new file with mode: 0644]
tests/source/configs/item_brace_style/prefer_same_line.rs [new file with mode: 0644]
tests/source/configs/item_brace_style/same_line_where.rs [new file with mode: 0644]
tests/source/configs/match_arm_blocks/false.rs [new file with mode: 0644]
tests/source/configs/match_arm_blocks/true.rs [new file with mode: 0644]
tests/source/configs/match_block_trailing_comma/false.rs [new file with mode: 0644]
tests/source/configs/match_block_trailing_comma/true.rs [new file with mode: 0644]
tests/source/configs/merge_derives/true.rs [new file with mode: 0644]
tests/source/configs/normalize_comments/false.rs [new file with mode: 0644]
tests/source/configs/normalize_comments/true.rs [new file with mode: 0644]
tests/source/configs/reorder_imported_names/false.rs [new file with mode: 0644]
tests/source/configs/reorder_imported_names/true.rs [new file with mode: 0644]
tests/source/configs/reorder_imports/false.rs [new file with mode: 0644]
tests/source/configs/reorder_imports/true.rs [new file with mode: 0644]
tests/source/configs/reorder_imports_in_group/false.rs [new file with mode: 0644]
tests/source/configs/reorder_imports_in_group/true.rs [new file with mode: 0644]
tests/source/configs/same_line_attributes/false.rs [new file with mode: 0644]
tests/source/configs/same_line_attributes/true.rs [new file with mode: 0644]
tests/source/configs/space_before_colon/true.rs [new file with mode: 0644]
tests/source/configs/spaces_around_ranges/false.rs [new file with mode: 0644]
tests/source/configs/spaces_around_ranges/true.rs [new file with mode: 0644]
tests/source/configs/spaces_within_parens_and_brackets/false.rs [new file with mode: 0644]
tests/source/configs/spaces_within_parens_and_brackets/true.rs [new file with mode: 0644]
tests/source/configs/struct_field_align_threshold/20.rs [new file with mode: 0644]
tests/source/configs/struct_lit_indent/block.rs [new file with mode: 0644]
tests/source/configs/struct_lit_indent/visual.rs [new file with mode: 0644]
tests/source/configs/struct_lit_single_line/false.rs [new file with mode: 0644]
tests/source/configs/tab_spaces/2.rs [new file with mode: 0644]
tests/source/configs/tab_spaces/4.rs [new file with mode: 0644]
tests/source/configs/trailing_comma/always.rs [new file with mode: 0644]
tests/source/configs/trailing_comma/never.rs [new file with mode: 0644]
tests/source/configs/trailing_comma/vertical.rs [new file with mode: 0644]
tests/source/configs/type_punctuation_density/compressed.rs [new file with mode: 0644]
tests/source/configs/type_punctuation_density/wide.rs [new file with mode: 0644]
tests/source/configs/use_try_shorthand/false.rs [new file with mode: 0644]
tests/source/configs/use_try_shorthand/true.rs [new file with mode: 0644]
tests/source/configs/where_pred_indent/block.rs [new file with mode: 0644]
tests/source/configs/where_pred_indent/visual.rs [new file with mode: 0644]
tests/source/configs/where_single_line/true.rs [new file with mode: 0644]
tests/source/configs/where_style/default.rs [new file with mode: 0644]
tests/source/configs/where_style/rfc.rs [new file with mode: 0644]
tests/source/configs/wrap_comments/false.rs [new file with mode: 0644]
tests/source/configs/wrap_comments/true.rs [new file with mode: 0644]
tests/target/configs-array_indent-block.rs [deleted file]
tests/target/configs-array_indent-visual.rs [deleted file]
tests/target/configs-blank_lines_lower_bound-1.rs [deleted file]
tests/target/configs-chain_indent-block.rs [deleted file]
tests/target/configs-chain_indent-visual.rs [deleted file]
tests/target/configs-combine_control_expr-false.rs [deleted file]
tests/target/configs-combine_control_expr-true.rs [deleted file]
tests/target/configs-comment_width-above.rs [deleted file]
tests/target/configs-comment_width-below.rs [deleted file]
tests/target/configs-comment_width-ignore.rs [deleted file]
tests/target/configs-condense_wildcard_suffices-false.rs [deleted file]
tests/target/configs-condense_wildcard_suffices-true.rs [deleted file]
tests/target/configs-control_brace_style-always_next_line.rs [deleted file]
tests/target/configs-control_brace_style-always_same_line.rs [deleted file]
tests/target/configs-control_brace_style-closing_next_line.rs [deleted file]
tests/target/configs-control_style-rfc.rs [deleted file]
tests/target/configs-disable_all_formatting-false.rs [deleted file]
tests/target/configs-disable_all_formatting-true.rs [deleted file]
tests/target/configs-empty_item_single_line-false.rs [deleted file]
tests/target/configs-empty_item_single_line-true.rs [deleted file]
tests/target/configs-error_on_line_overflow-false.rs [deleted file]
tests/target/configs-error_on_unformatted-false.rs [deleted file]
tests/target/configs-fn_args_density-compressed.rs [deleted file]
tests/target/configs-fn_args_density-tall.rs [deleted file]
tests/target/configs-fn_args_density-vertical.rs [deleted file]
tests/target/configs-fn_args_indent-block.rs [deleted file]
tests/target/configs-fn_args_indent-visual.rs [deleted file]
tests/target/configs-fn_brace_style-always_next_line.rs [deleted file]
tests/target/configs-fn_brace_style-prefer_same_line.rs [deleted file]
tests/target/configs-fn_brace_style-same_line_where.rs [deleted file]
tests/target/configs-fn_call_indent-block.rs [deleted file]
tests/target/configs-fn_call_indent-block_tab_spaces_2.rs [deleted file]
tests/target/configs-fn_call_indent-block_trailing_comma.rs [deleted file]
tests/target/configs-fn_call_indent-visual.rs [deleted file]
tests/target/configs-fn_call_indent-visual_trailing_comma.rs [deleted file]
tests/target/configs-fn_single_line-false.rs [deleted file]
tests/target/configs-fn_single_line-true.rs [deleted file]
tests/target/configs-force_explicit_abi-false.rs [deleted file]
tests/target/configs-force_explicit_abi-true.rs [deleted file]
tests/target/configs-force_multiline_block-false.rs [deleted file]
tests/target/configs-force_multiline_block-true.rs [deleted file]
tests/target/configs-format_strings-false.rs [deleted file]
tests/target/configs-format_strings-true.rs [deleted file]
tests/target/configs-generics_indent-block.rs [deleted file]
tests/target/configs-generics_indent-visual.rs [deleted file]
tests/target/configs-hard_tabs-false.rs [deleted file]
tests/target/configs-hard_tabs-true.rs [deleted file]
tests/target/configs-imports_indent-block.rs [deleted file]
tests/target/configs-imports_layout-horizontal_vertical.rs [deleted file]
tests/target/configs-imports_layout-mixed.rs [deleted file]
tests/target/configs-item_brace_style-always_next_line.rs [deleted file]
tests/target/configs-item_brace_style-prefer_same_line.rs [deleted file]
tests/target/configs-item_brace_style-same_line_where.rs [deleted file]
tests/target/configs-match_arm_blocks-false.rs [deleted file]
tests/target/configs-match_arm_blocks-true.rs [deleted file]
tests/target/configs-match_block_trailing_comma-false.rs [deleted file]
tests/target/configs-match_block_trailing_comma-true.rs [deleted file]
tests/target/configs-merge_derives-true.rs [deleted file]
tests/target/configs-normalize_comments-false.rs [deleted file]
tests/target/configs-normalize_comments-true.rs [deleted file]
tests/target/configs-reorder_imported_names-false.rs [deleted file]
tests/target/configs-reorder_imported_names-true.rs [deleted file]
tests/target/configs-reorder_imports-false.rs [deleted file]
tests/target/configs-reorder_imports-true.rs [deleted file]
tests/target/configs-reorder_imports_in_group-false.rs [deleted file]
tests/target/configs-reorder_imports_in_group-true.rs [deleted file]
tests/target/configs-same_line_attributes-false.rs [deleted file]
tests/target/configs-same_line_attributes-true.rs [deleted file]
tests/target/configs-space_before_colon-true.rs [deleted file]
tests/target/configs-spaces_around_ranges-false.rs [deleted file]
tests/target/configs-spaces_around_ranges-true.rs [deleted file]
tests/target/configs-spaces_within_parens_and_brackets-false.rs [deleted file]
tests/target/configs-spaces_within_parens_and_brackets-true.rs [deleted file]
tests/target/configs-struct_field_align_threshold-20.rs [deleted file]
tests/target/configs-struct_lit_indent-block.rs [deleted file]
tests/target/configs-struct_lit_indent-visual.rs [deleted file]
tests/target/configs-struct_lit_single_line-false.rs [deleted file]
tests/target/configs-tab_spaces-2.rs [deleted file]
tests/target/configs-tab_spaces-4.rs [deleted file]
tests/target/configs-trailing_comma-always.rs [deleted file]
tests/target/configs-trailing_comma-never.rs [deleted file]
tests/target/configs-trailing_comma-vertical.rs [deleted file]
tests/target/configs-trailing_semicolon-false.rs [deleted file]
tests/target/configs-trailing_semicolon-true.rs [deleted file]
tests/target/configs-type_punctuation_density-compressed.rs [deleted file]
tests/target/configs-type_punctuation_density-wide.rs [deleted file]
tests/target/configs-use_try_shorthand-false.rs [deleted file]
tests/target/configs-use_try_shorthand-true.rs [deleted file]
tests/target/configs-where_pred_indent-block.rs [deleted file]
tests/target/configs-where_pred_indent-visual.rs [deleted file]
tests/target/configs-where_single_line-true.rs [deleted file]
tests/target/configs-where_style-default.rs [deleted file]
tests/target/configs-where_style-rfc.rs [deleted file]
tests/target/configs-wrap_comments-false.rs [deleted file]
tests/target/configs-wrap_comments-true.rs [deleted file]
tests/target/configs/array_indent/block.rs [new file with mode: 0644]
tests/target/configs/array_indent/visual.rs [new file with mode: 0644]
tests/target/configs/blank_lines_lower_bound/1.rs [new file with mode: 0644]
tests/target/configs/chain_indent/block.rs [new file with mode: 0644]
tests/target/configs/chain_indent/visual.rs [new file with mode: 0644]
tests/target/configs/combine_control_expr/false.rs [new file with mode: 0644]
tests/target/configs/combine_control_expr/true.rs [new file with mode: 0644]
tests/target/configs/comment_width/above.rs [new file with mode: 0644]
tests/target/configs/comment_width/below.rs [new file with mode: 0644]
tests/target/configs/comment_width/ignore.rs [new file with mode: 0644]
tests/target/configs/condense_wildcard_suffices/false.rs [new file with mode: 0644]
tests/target/configs/condense_wildcard_suffices/true.rs [new file with mode: 0644]
tests/target/configs/control_brace_style/always_next_line.rs [new file with mode: 0644]
tests/target/configs/control_brace_style/always_same_line.rs [new file with mode: 0644]
tests/target/configs/control_brace_style/closing_next_line.rs [new file with mode: 0644]
tests/target/configs/control_style/rfc.rs [new file with mode: 0644]
tests/target/configs/disable_all_formatting/false.rs [new file with mode: 0644]
tests/target/configs/disable_all_formatting/true.rs [new file with mode: 0644]
tests/target/configs/empty_item_single_line/false.rs [new file with mode: 0644]
tests/target/configs/empty_item_single_line/true.rs [new file with mode: 0644]
tests/target/configs/error_on_line_overflow/false.rs [new file with mode: 0644]
tests/target/configs/error_on_unformatted/false.rs [new file with mode: 0644]
tests/target/configs/fn_args_density/compressed.rs [new file with mode: 0644]
tests/target/configs/fn_args_density/tall.rs [new file with mode: 0644]
tests/target/configs/fn_args_density/vertical.rs [new file with mode: 0644]
tests/target/configs/fn_args_indent/block.rs [new file with mode: 0644]
tests/target/configs/fn_args_indent/visual.rs [new file with mode: 0644]
tests/target/configs/fn_brace_style/always_next_line.rs [new file with mode: 0644]
tests/target/configs/fn_brace_style/prefer_same_line.rs [new file with mode: 0644]
tests/target/configs/fn_brace_style/same_line_where.rs [new file with mode: 0644]
tests/target/configs/fn_call_indent/block.rs [new file with mode: 0644]
tests/target/configs/fn_call_indent/block_tab_spaces_2.rs [new file with mode: 0644]
tests/target/configs/fn_call_indent/block_trailing_comma.rs [new file with mode: 0644]
tests/target/configs/fn_call_indent/visual.rs [new file with mode: 0644]
tests/target/configs/fn_call_indent/visual_trailing_comma.rs [new file with mode: 0644]
tests/target/configs/fn_single_line/false.rs [new file with mode: 0644]
tests/target/configs/fn_single_line/true.rs [new file with mode: 0644]
tests/target/configs/force_explicit_abi/false.rs [new file with mode: 0644]
tests/target/configs/force_explicit_abi/true.rs [new file with mode: 0644]
tests/target/configs/force_multiline_block/false.rs [new file with mode: 0644]
tests/target/configs/force_multiline_block/true.rs [new file with mode: 0644]
tests/target/configs/format_strings/false.rs [new file with mode: 0644]
tests/target/configs/format_strings/true.rs [new file with mode: 0644]
tests/target/configs/generics_indent/block.rs [new file with mode: 0644]
tests/target/configs/generics_indent/visual.rs [new file with mode: 0644]
tests/target/configs/hard_tabs/false.rs [new file with mode: 0644]
tests/target/configs/hard_tabs/true.rs [new file with mode: 0644]
tests/target/configs/imports_indent/block.rs [new file with mode: 0644]
tests/target/configs/imports_layout/horizontal_vertical.rs [new file with mode: 0644]
tests/target/configs/imports_layout/mixed.rs [new file with mode: 0644]
tests/target/configs/item_brace_style/always_next_line.rs [new file with mode: 0644]
tests/target/configs/item_brace_style/prefer_same_line.rs [new file with mode: 0644]
tests/target/configs/item_brace_style/same_line_where.rs [new file with mode: 0644]
tests/target/configs/match_arm_blocks/false.rs [new file with mode: 0644]
tests/target/configs/match_arm_blocks/true.rs [new file with mode: 0644]
tests/target/configs/match_block_trailing_comma/false.rs [new file with mode: 0644]
tests/target/configs/match_block_trailing_comma/true.rs [new file with mode: 0644]
tests/target/configs/merge_derives/true.rs [new file with mode: 0644]
tests/target/configs/normalize_comments/false.rs [new file with mode: 0644]
tests/target/configs/normalize_comments/true.rs [new file with mode: 0644]
tests/target/configs/reorder_imported_names/false.rs [new file with mode: 0644]
tests/target/configs/reorder_imported_names/true.rs [new file with mode: 0644]
tests/target/configs/reorder_imports/false.rs [new file with mode: 0644]
tests/target/configs/reorder_imports/true.rs [new file with mode: 0644]
tests/target/configs/reorder_imports_in_group/false.rs [new file with mode: 0644]
tests/target/configs/reorder_imports_in_group/true.rs [new file with mode: 0644]
tests/target/configs/same_line_attributes/false.rs [new file with mode: 0644]
tests/target/configs/same_line_attributes/true.rs [new file with mode: 0644]
tests/target/configs/space_before_colon/true.rs [new file with mode: 0644]
tests/target/configs/spaces_around_ranges/false.rs [new file with mode: 0644]
tests/target/configs/spaces_around_ranges/true.rs [new file with mode: 0644]
tests/target/configs/spaces_within_parens_and_brackets/false.rs [new file with mode: 0644]
tests/target/configs/spaces_within_parens_and_brackets/true.rs [new file with mode: 0644]
tests/target/configs/struct_field_align_threshold/20.rs [new file with mode: 0644]
tests/target/configs/struct_lit_indent/block.rs [new file with mode: 0644]
tests/target/configs/struct_lit_indent/visual.rs [new file with mode: 0644]
tests/target/configs/struct_lit_single_line/false.rs [new file with mode: 0644]
tests/target/configs/tab_spaces/2.rs [new file with mode: 0644]
tests/target/configs/tab_spaces/4.rs [new file with mode: 0644]
tests/target/configs/trailing_comma/always.rs [new file with mode: 0644]
tests/target/configs/trailing_comma/never.rs [new file with mode: 0644]
tests/target/configs/trailing_comma/vertical.rs [new file with mode: 0644]
tests/target/configs/trailing_semicolon/false.rs [new file with mode: 0644]
tests/target/configs/trailing_semicolon/true.rs [new file with mode: 0644]
tests/target/configs/type_punctuation_density/compressed.rs [new file with mode: 0644]
tests/target/configs/type_punctuation_density/wide.rs [new file with mode: 0644]
tests/target/configs/use_try_shorthand/false.rs [new file with mode: 0644]
tests/target/configs/use_try_shorthand/true.rs [new file with mode: 0644]
tests/target/configs/where_pred_indent/block.rs [new file with mode: 0644]
tests/target/configs/where_pred_indent/visual.rs [new file with mode: 0644]
tests/target/configs/where_single_line/true.rs [new file with mode: 0644]
tests/target/configs/where_style/default.rs [new file with mode: 0644]
tests/target/configs/where_style/rfc.rs [new file with mode: 0644]
tests/target/configs/wrap_comments/false.rs [new file with mode: 0644]
tests/target/configs/wrap_comments/true.rs [new file with mode: 0644]

diff --git a/tests/source/configs-array_indent-block.rs b/tests/source/configs-array_indent-block.rs
deleted file mode 100644 (file)
index 8404f65..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Block
-// Array layout
-
-fn main() {
-    let lorem = vec!["ipsum","dolor","sit","amet","consectetur","adipiscing","elit"];
-}
diff --git a/tests/source/configs-array_indent-visual.rs b/tests/source/configs-array_indent-visual.rs
deleted file mode 100644 (file)
index 05bbf00..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Array layout
-
-fn main() {
-    let lorem = vec!["ipsum","dolor","sit","amet","consectetur","adipiscing","elit"];
-}
diff --git a/tests/source/configs-blank_lines_lower_bound-1.rs b/tests/source/configs-blank_lines_lower_bound-1.rs
deleted file mode 100644 (file)
index c6058a5..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-blank_lines_lower_bound: 1
-
-fn foo() {}
-fn bar() {}
-// comment
-fn foobar() {}
-
-fn foo1() {}
-fn bar1() {}
-
-// comment
-
-fn foobar1() {}
diff --git a/tests/source/configs-chain_indent-block.rs b/tests/source/configs-chain_indent-block.rs
deleted file mode 100644 (file)
index 41d9146..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Block
-// Chain indent
-
-fn main() {
-    let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elite();
-}
diff --git a/tests/source/configs-chain_indent-visual.rs b/tests/source/configs-chain_indent-visual.rs
deleted file mode 100644 (file)
index b749487..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Chain indent
-
-fn main() {
-    let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elite();
-}
diff --git a/tests/source/configs-comment_width-above.rs b/tests/source/configs-comment_width-above.rs
deleted file mode 100644 (file)
index 36187ce..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-comment_width: 40
-// rustfmt-wrap_comments: true
-// Comment width
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-}
diff --git a/tests/source/configs-comment_width-below.rs b/tests/source/configs-comment_width-below.rs
deleted file mode 100644 (file)
index abbc593..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-comment_width: 80
-// rustfmt-wrap_comments: true
-// Comment width
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-}
diff --git a/tests/source/configs-comment_width-ignore.rs b/tests/source/configs-comment_width-ignore.rs
deleted file mode 100644 (file)
index c86e71c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-comment_width: 40
-// rustfmt-wrap_comments: false
-// Comment width
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-}
diff --git a/tests/source/configs-condense_wildcard_suffices-false.rs b/tests/source/configs-condense_wildcard_suffices-false.rs
deleted file mode 100644 (file)
index 3b967f3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-condense_wildcard_suffixes: false
-// Condense wildcard suffixes
-
-fn main() {
-    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
-}
diff --git a/tests/source/configs-condense_wildcard_suffices-true.rs b/tests/source/configs-condense_wildcard_suffices-true.rs
deleted file mode 100644 (file)
index 3798a6b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-condense_wildcard_suffixes: true
-// Condense wildcard suffixes
-
-fn main() {
-    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
-}
diff --git a/tests/source/configs-control_brace_style-always_next_line.rs b/tests/source/configs-control_brace_style-always_next_line.rs
deleted file mode 100644 (file)
index c4ddad9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// rustfmt-control_brace_style: AlwaysNextLine
-// Control brace style
-
-fn main() {
-    if lorem { println!("ipsum!"); } else { println!("dolor!"); }
-    match magi {
-        Homura => "Akemi",
-        Madoka => "Kaname",
-    }
-}
diff --git a/tests/source/configs-control_brace_style-always_same_line.rs b/tests/source/configs-control_brace_style-always_same_line.rs
deleted file mode 100644 (file)
index a9c699d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// rustfmt-control_brace_style: AlwaysSameLine
-// Control brace style
-
-fn main() {
-    if lorem { println!("ipsum!"); } else { println!("dolor!"); }
-    match magi {
-        Homura => "Akemi",
-        Madoka => "Kaname",
-    }
-}
diff --git a/tests/source/configs-control_brace_style-closing_next_line.rs b/tests/source/configs-control_brace_style-closing_next_line.rs
deleted file mode 100644 (file)
index 1a74a28..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// rustfmt-control_brace_style: ClosingNextLine
-// Control brace style
-
-fn main() {
-    if lorem { println!("ipsum!"); } else { println!("dolor!"); }
-    match magi {
-        Homura => "Akemi",
-        Madoka => "Kaname",
-    }
-}
diff --git a/tests/source/configs-disable_all_formatting-false.rs b/tests/source/configs-disable_all_formatting-false.rs
deleted file mode 100644 (file)
index 834ca7a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-disable_all_formatting: false
-// Disable all formatting
-
-fn main() {
-    if lorem{println!("ipsum!");}else{println!("dolor!");}
-}
diff --git a/tests/source/configs-disable_all_formatting-true.rs b/tests/source/configs-disable_all_formatting-true.rs
deleted file mode 100644 (file)
index 56955bf..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-disable_all_formatting: true
-// Disable all formatting
-
-fn main() {
-    iflorem{println!("ipsum!");}else{println!("dolor!");}
-}
diff --git a/tests/source/configs-empty_item_single_line-false.rs b/tests/source/configs-empty_item_single_line-false.rs
deleted file mode 100644 (file)
index 8fa74f2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// rustfmt-empty_item_single_line: false
-// Empty impl on single line
-
-impl Lorem {
-
-}
-
-impl Ipsum {
-
-}
-
-fn lorem() {
-}
-
-fn lorem() {
-
-}
diff --git a/tests/source/configs-empty_item_single_line-true.rs b/tests/source/configs-empty_item_single_line-true.rs
deleted file mode 100644 (file)
index 02e703d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// rustfmt-empty_item_single_line: true
-// Empty impl on single line
-
-impl Lorem {
-
-}
-
-impl Ipsum {
-
-}
-
-fn lorem() {
-}
-
-fn lorem() {
-
-}
diff --git a/tests/source/configs-error_on_line_overflow-false.rs b/tests/source/configs-error_on_line_overflow-false.rs
deleted file mode 100644 (file)
index fa70ae7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-error_on_line_overflow: false
-// Error on line overflow
-
-fn main() {
-    let lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit_lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit;
-}
diff --git a/tests/source/configs-fn_args_density-compressed.rs b/tests/source/configs-fn_args_density-compressed.rs
deleted file mode 100644 (file)
index 86c0b42..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-fn_args_density: Compressed
-// Function arguments density
-
-trait Lorem {
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
-        // body
-    }
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) {
-        // body
-    }
-}
diff --git a/tests/source/configs-fn_args_density-tall.rs b/tests/source/configs-fn_args_density-tall.rs
deleted file mode 100644 (file)
index fc400e1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-fn_args_density: Tall
-// Function arguments density
-
-trait Lorem {
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
-        // body
-    }
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) {
-        // body
-    }
-}
diff --git a/tests/source/configs-fn_args_density-vertical.rs b/tests/source/configs-fn_args_density-vertical.rs
deleted file mode 100644 (file)
index 20b1427..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-fn_args_density: Vertical
-// Function arguments density
-
-trait Lorem {
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
-        // body
-    }
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) {
-        // body
-    }
-}
diff --git a/tests/source/configs-fn_args_indent-block.rs b/tests/source/configs-fn_args_indent-block.rs
deleted file mode 100644 (file)
index 4d2d280..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// rustfmt-indent_style: Block
-// Function arguments layout
-
-fn lorem() {}
-
-fn lorem(ipsum: usize) {}
-
-fn lorem(ipsum: usize, dolor: usize, sit: usize, amet: usize, consectetur: usize, adipiscing: usize, elit: usize) {
-    // body
-}
-
-// #1441
-extern "system" {
-    pub fn GetConsoleHistoryInfo(console_history_info: *mut ConsoleHistoryInfo) -> Boooooooooooooool;
-}
-
-// rustfmt should not add trailing comma for variadic function. See #1623.
-extern "C" {
-    pub fn variadic_fn(first_parameter: FirstParameterType,
-                       second_parameter: SecondParameterType,
-                       ...);
-}
-
-// #1652
-fn deconstruct(foo: Bar) -> (SocketAddr, Header, Method, RequestUri, HttpVersion, AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {
-}
diff --git a/tests/source/configs-fn_args_indent-visual.rs b/tests/source/configs-fn_args_indent-visual.rs
deleted file mode 100644 (file)
index 5aa28a6..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// rustfmt-indent_style: Visual
-// Function arguments layout
-
-fn lorem() {}
-
-fn lorem(ipsum: usize) {}
-
-fn lorem(ipsum: usize, dolor: usize, sit: usize, amet: usize, consectetur: usize, adipiscing: usize, elit: usize) {
-    // body
-}
-
-// #1922
-extern "C" {
-    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
-            uplo: c_char,
-                n: lapack_int,
-        nrhs: lapack_int,
-        a: *const lapack_complex_float,
-                    lda: lapack_int, ipiv: *const lapack_int,
-        b: *mut lapack_complex_float,
-            ldb: lapack_int
-    )-> lapack_int;
-
-    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
-            uplo: c_char,
-                n: lapack_int,
-        nrhs: lapack_int,
-                    lda: lapack_int, ipiv: *const lapack_int,
-        b: *mut lapack_complex_float,
-            ldb: lapack_int
-    ) -> lapack_int;
-}
diff --git a/tests/source/configs-fn_brace_style-always_next_line.rs b/tests/source/configs-fn_brace_style-always_next_line.rs
deleted file mode 100644 (file)
index d3bd9ac..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-brace_style: AlwaysNextLine
-// Function brace style
-
-fn lorem() {
-    // body
-}
-
-fn lorem(ipsum: usize) {
-    // body
-}
-
-fn lorem<T>(ipsum: T) where T: Add + Sub + Mul + Div {
-    // body
-}
diff --git a/tests/source/configs-fn_brace_style-prefer_same_line.rs b/tests/source/configs-fn_brace_style-prefer_same_line.rs
deleted file mode 100644 (file)
index 78a4495..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-brace_style: PreferSameLine
-// Function brace style
-
-fn lorem() {
-    // body
-}
-
-fn lorem(ipsum: usize) {
-    // body
-}
-
-fn lorem<T>(ipsum: T) where T: Add + Sub + Mul + Div {
-    // body
-}
diff --git a/tests/source/configs-fn_brace_style-same_line_where.rs b/tests/source/configs-fn_brace_style-same_line_where.rs
deleted file mode 100644 (file)
index 3b78932..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-brace_style: SameLineWhere
-// Function brace style
-
-fn lorem() {
-    // body
-}
-
-fn lorem(ipsum: usize) {
-    // body
-}
-
-fn lorem<T>(ipsum: T) where T: Add + Sub + Mul + Div {
-    // body
-}
diff --git a/tests/source/configs-fn_call_indent-block.rs b/tests/source/configs-fn_call_indent-block.rs
deleted file mode 100644 (file)
index c82b6b8..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-// rustfmt-indent_style: Block
-// Function call style
-
-fn main() {
-    lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
-    // #1501
-    let hyper = Arc::new(Client::with_connector(HttpsConnector::new(TlsClient::new())));
-
-    // chain
-    let x = yooooooooooooo.fooooooooooooooo.baaaaaaaaaaaaar(hello, world);
-
-    // #1380
-    {
-        {
-            let creds = self.client
-                .client_credentials(&self.config.auth.oauth2.id, &self.config.auth.oauth2.secret)?;
-        }
-    }
-
-    // nesting macro and function call
-    try!(foo(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx));
-    try!(foo(try!(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)));
-}
-
-// #1521
-impl Foo {
-    fn map_pixel_to_coords(&self, point: &Vector2i, view: &View) -> Vector2f {
-        unsafe {
-            Vector2f::from_raw(ffi::sfRenderTexture_mapPixelToCoords(self.render_texture, point.raw(), view.raw()))
-        }
-    }
-}
-
-fn issue1420() {
-    given(
-        r#"
-        # Getting started
-        ...
-    "#,
-    )
-        .running(waltz)
-}
-
-// #1563
-fn query(conn: &Connection) -> Result<()> {
-    conn.query_row(
-        r#"
-            SELECT title, date
-            FROM posts,
-            WHERE DATE(date) = $1
-        "#,
-        &[],
-        |row| {
-            Post {
-                title: row.get(0),
-                date: row.get(1),
-            }
-        },
-    )?;
-
-    Ok(())
-}
-
-// #1449
-fn future_rayon_wait_1_thread() {
-    // run with only 1 worker thread; this would deadlock if we couldn't make progress
-    let mut result = None;
-    ThreadPool::new(Configuration::new().num_threads(1))
-        .unwrap()
-        .install(
-            || {
-                scope(
-                    |s| {
-                        use std::sync::mpsc::channel;
-                        let (tx, rx) = channel();
-                        let a = s.spawn_future(lazy(move || Ok::<usize, ()>(rx.recv().unwrap())));
-                        //                          ^^^^ FIXME: why is this needed?
-                        let b = s.spawn_future(a.map(|v| v + 1));
-                        let c = s.spawn_future(b.map(|v| v + 1));
-                        s.spawn(move |_| tx.send(20).unwrap());
-                        result = Some(c.rayon_wait().unwrap());
-                    },
-                );
-            },
-        );
-    assert_eq!(result, Some(22));
-}
-
-// #1494
-impl Cursor {
-    fn foo() {
-        self.cur_type()
-            .num_template_args()
-            .or_else(|| {
-                let n: c_int = unsafe { clang_Cursor_getNumTemplateArguments(self.x) };
-
-                if n >= 0 {
-                    Some(n as u32)
-                } else {
-                    debug_assert_eq!(n, -1);
-                    None
-                }
-            })
-            .or_else(|| {
-                let canonical = self.canonical();
-                if canonical != *self {
-                    canonical.num_template_args()
-                } else {
-                    None
-                }
-            });
-    }
-}
-
-fn issue1581() {
-    bootstrap.checks.register(
-        "PERSISTED_LOCATIONS",
-        move || if locations2.0.inner_mut.lock().poisoned {
-            Check::new(
-                State::Error,
-                "Persisted location storage is poisoned due to a write failure",
-            )
-        } else {
-            Check::new(State::Healthy, "Persisted location storage is healthy")
-        },
-    );
-}
-
-fn issue1651() {
-    {
-        let type_list: Vec<_> = try_opt!(types.iter().map(|ty| ty.rewrite(context, shape)).collect());
-    }
-}
diff --git a/tests/source/configs-fn_call_indent-block_trailing_comma.rs b/tests/source/configs-fn_call_indent-block_trailing_comma.rs
deleted file mode 100644 (file)
index c907ec5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// rustfmt-error_on_line_overflow: false
-// rustfmt-indent_style: Block
-
-// rustfmt should not add trailing comma when rewriting macro. See #1528.
-fn a() {
-    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
-    foo(a, oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt());
-}
diff --git a/tests/source/configs-fn_call_indent-visual.rs b/tests/source/configs-fn_call_indent-visual.rs
deleted file mode 100644 (file)
index 9a679d6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Function call style
-
-fn main() {
-    lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
-}
diff --git a/tests/source/configs-fn_call_indent-visual_trailing_comma.rs b/tests/source/configs-fn_call_indent-visual_trailing_comma.rs
deleted file mode 100644 (file)
index 9738d39..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-error_on_line_overflow: false
-// rustfmt-indent_style: Visual
-
-// rustfmt should not add trailing comma when rewriting macro. See #1528.
-fn a() {
-    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
-}
diff --git a/tests/source/configs-fn_single_line-false.rs b/tests/source/configs-fn_single_line-false.rs
deleted file mode 100644 (file)
index 3d092f0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-fn_single_line: false
-// Single-expression function on single line
-
-fn lorem() -> usize {
-    42
-}
-
-fn lorem() -> usize {
-    let ipsum = 42;
-    ipsum
-}
diff --git a/tests/source/configs-fn_single_line-true.rs b/tests/source/configs-fn_single_line-true.rs
deleted file mode 100644 (file)
index 3cb0fde..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-fn_single_line: true
-// Single-expression function on single line
-
-fn lorem() -> usize {
-    42
-}
-
-fn lorem() -> usize {
-    let ipsum = 42;
-    ipsum
-}
diff --git a/tests/source/configs-force_explicit_abi-false.rs b/tests/source/configs-force_explicit_abi-false.rs
deleted file mode 100644 (file)
index 3c48f8e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-force_explicit_abi: false
-// Force explicit abi
-
-extern {
-    pub static lorem: c_int;
-}
diff --git a/tests/source/configs-force_explicit_abi-true.rs b/tests/source/configs-force_explicit_abi-true.rs
deleted file mode 100644 (file)
index e5ff6cf..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-force_explicit_abi: true
-// Force explicit abi
-
-extern {
-    pub static lorem: c_int;
-}
diff --git a/tests/source/configs-force_multiline_block-false.rs b/tests/source/configs-force_multiline_block-false.rs
deleted file mode 100644 (file)
index b97e348..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// rustfmt-force_multiline_blocks: false
-// Option forces multiline match arm and closure bodies to be wrapped in a block
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            if ipsum {
-                println!("dolor");
-            }
-        }
-        Lorem::Dolor => println!("amet"),
-    }
-}
-
-fn main() {
-    result.and_then(|maybe_value| {
-        match maybe_value {
-            None => Err("oops"),
-            Some(value) => Ok(1),
-        }
-    });
-}
diff --git a/tests/source/configs-force_multiline_block-true.rs b/tests/source/configs-force_multiline_block-true.rs
deleted file mode 100644 (file)
index db9d3de..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// rustfmt-force_multiline_blocks: true
-// Option forces multiline match arm and closure bodies to be wrapped in a block
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => if ipsum {
-            println!("dolor");
-        },
-        Lorem::Dolor => println!("amet"),
-    }
-}
-
-fn main() {
-    result.and_then(|maybe_value| match maybe_value {
-        None => Err("oops"),
-        Some(value) => Ok(1),
-    });
-}
diff --git a/tests/source/configs-format_strings-false.rs b/tests/source/configs-format_strings-false.rs
deleted file mode 100644 (file)
index ecca0d7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// rustfmt-format_strings: false
-// rustfmt-max_width: 50
-// rustfmt-error_on_line_overflow: false
-// Force format strings
-
-fn main() {
-    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
-}
diff --git a/tests/source/configs-format_strings-true.rs b/tests/source/configs-format_strings-true.rs
deleted file mode 100644 (file)
index 3373144..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-format_strings: true
-// rustfmt-max_width: 50
-// Force format strings
-
-fn main() {
-    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
-}
diff --git a/tests/source/configs-generics_indent-block.rs b/tests/source/configs-generics_indent-block.rs
deleted file mode 100644 (file)
index 2cf17be..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Block
-// Generics indent
-
-fn lorem<Ipsum: Eq = usize, Dolor: Eq = usize, Sit: Eq = usize, Amet: Eq = usize, Adipiscing: Eq = usize, Consectetur: Eq = usize, Elit: Eq = usize>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, adipiscing: Adipiscing, consectetur: Consectetur, elit: Elit) -> T {
-    // body
-}
diff --git a/tests/source/configs-generics_indent-visual.rs b/tests/source/configs-generics_indent-visual.rs
deleted file mode 100644 (file)
index 1f910d3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Generics indent
-
-fn lorem<Ipsum: Eq = usize, Dolor: Eq = usize, Sit: Eq = usize, Amet: Eq = usize, Adipiscing: Eq = usize, Consectetur: Eq = usize, Elit: Eq = usize>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, adipiscing: Adipiscing, consectetur: Consectetur, elit: Elit) -> T {
-    // body
-}
diff --git a/tests/source/configs-hard_tabs-false.rs b/tests/source/configs-hard_tabs-false.rs
deleted file mode 100644 (file)
index bf92162..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-hard_tabs: false
-// Hard tabs
-
-fn lorem() -> usize {
-42 // spaces before 42
-}
diff --git a/tests/source/configs-hard_tabs-true.rs b/tests/source/configs-hard_tabs-true.rs
deleted file mode 100644 (file)
index 738922a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-hard_tabs: true
-// Hard tabs
-
-fn lorem() -> usize {
-42 // spaces before 42
-}
diff --git a/tests/source/configs-item_brace_style-always_next_line.rs b/tests/source/configs-item_brace_style-always_next_line.rs
deleted file mode 100644 (file)
index 0cc19b3..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// rustfmt-brace_style: AlwaysNextLine
-// Item brace style
-
-enum Foo {}
-
-struct Bar {}
-
-struct Lorem {
-    ipsum: bool,
-}
-
-struct Dolor<T> where T: Eq {
-    sit: T,
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn it_works() {}
-}
diff --git a/tests/source/configs-item_brace_style-prefer_same_line.rs b/tests/source/configs-item_brace_style-prefer_same_line.rs
deleted file mode 100644 (file)
index 4412bc8..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-brace_style: PreferSameLine
-// Item brace style
-
-struct Lorem {
-    ipsum: bool,
-}
-
-struct Dolor<T> where T: Eq {
-    sit: T,
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn it_works() {}
-}
diff --git a/tests/source/configs-item_brace_style-same_line_where.rs b/tests/source/configs-item_brace_style-same_line_where.rs
deleted file mode 100644 (file)
index b8e6914..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-brace_style: SameLineWhere
-// Item brace style
-
-struct Lorem {
-    ipsum: bool,
-}
-
-struct Dolor<T> where T: Eq {
-    sit: T,
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn it_works() {}
-}
diff --git a/tests/source/configs-match_arm_blocks-false.rs b/tests/source/configs-match_arm_blocks-false.rs
deleted file mode 100644 (file)
index 53e37e1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_arm_blocks: false
-// Wrap match-arms
-
-fn main() {
-    match lorem {
-        true => foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
-        false => {
-            println!("{}", sit)
-        }
-    }
-}
diff --git a/tests/source/configs-match_arm_blocks-true.rs b/tests/source/configs-match_arm_blocks-true.rs
deleted file mode 100644 (file)
index a452b13..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_arm_blocks: true
-// Wrap match-arms
-
-fn main() {
-    match lorem {
-        true => foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
-        false => {
-            println!("{}", sit)
-        }
-    }
-}
diff --git a/tests/source/configs-match_block_trailing_comma-false.rs b/tests/source/configs-match_block_trailing_comma-false.rs
deleted file mode 100644 (file)
index 70e0295..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_block_trailing_comma: false
-// Match block trailing comma
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            println!("ipsum");
-        }
-        Lorem::Dolor => println!("dolor"),
-    }
-}
diff --git a/tests/source/configs-match_block_trailing_comma-true.rs b/tests/source/configs-match_block_trailing_comma-true.rs
deleted file mode 100644 (file)
index b9af3d4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_block_trailing_comma: true
-// Match block trailing comma
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            println!("ipsum");
-        }
-        Lorem::Dolor => println!("dolor"),
-    }
-}
diff --git a/tests/source/configs-merge_derives-true.rs b/tests/source/configs-merge_derives-true.rs
deleted file mode 100644 (file)
index 18b8443..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// rustfmt-merge_derives: true
-// Merge multiple derives to a single one.
-
-#[bar]
-#[derive(Eq, PartialEq)]
-#[foo]
-#[derive(Debug)]
-#[foobar]
-#[derive(Copy, Clone)]
-pub enum Foo {}
-
-#[derive(Eq, PartialEq)]
-#[derive(Debug)]
-#[foobar]
-#[derive(Copy, Clone)]
-pub enum Bar {}
-
-#[derive(Eq, PartialEq)]
-#[derive(Debug)]
-#[derive(Copy, Clone)]
-pub enum FooBar {}
-
-mod foo {
-#[bar]
-#[derive(Eq, PartialEq)]
-#[foo]
-#[derive(Debug)]
-#[foobar]
-#[derive(Copy, Clone)]
-pub enum Foo {}
-}
-
-mod bar {
-#[derive(Eq, PartialEq)]
-#[derive(Debug)]
-#[foobar]
-#[derive(Copy, Clone)]
-pub enum Bar {}
-}
-
-mod foobar {
-#[derive(Eq, PartialEq)]
-#[derive(Debug)]
-#[derive(Copy, Clone)]
-pub enum FooBar {}
-}
diff --git a/tests/source/configs-normalize_comments-false.rs b/tests/source/configs-normalize_comments-false.rs
deleted file mode 100644 (file)
index 488962e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-normalize_comments: false
-// Normalize comments
-
-// Lorem ipsum:
-fn dolor() -> usize {}
-
-/* sit amet: */
-fn adipiscing() -> usize {}
-
-// #652
-////////////////////////////////////////////////////////////////////////////////
-// Basic slice extension methods
-////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/source/configs-normalize_comments-true.rs b/tests/source/configs-normalize_comments-true.rs
deleted file mode 100644 (file)
index c74a980..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-normalize_comments: true
-// Normalize comments
-
-// Lorem ipsum:
-fn dolor() -> usize {}
-
-/* sit amet: */
-fn adipiscing() -> usize {}
-
-// #652
-////////////////////////////////////////////////////////////////////////////////
-// Basic slice extension methods
-////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/source/configs-reorder_imported_names-false.rs b/tests/source/configs-reorder_imported_names-false.rs
deleted file mode 100644 (file)
index 91db89c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// rustfmt-reorder_imported_names: false
-// Reorder imported names
-
-use super::{lorem, ipsum, dolor, sit};
diff --git a/tests/source/configs-reorder_imported_names-true.rs b/tests/source/configs-reorder_imported_names-true.rs
deleted file mode 100644 (file)
index 69da618..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// rustfmt-reorder_imported_names: true
-// Reorder imported names
-
-use super::{lorem, ipsum, dolor, sit};
diff --git a/tests/source/configs-reorder_imports-false.rs b/tests/source/configs-reorder_imports-false.rs
deleted file mode 100644 (file)
index 4b85684..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-reorder_imports: false
-// Reorder imports
-
-use lorem;
-use ipsum;
-use dolor;
-use sit;
diff --git a/tests/source/configs-reorder_imports-true.rs b/tests/source/configs-reorder_imports-true.rs
deleted file mode 100644 (file)
index 2a40f6d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// rustfmt-reorder_imports: true
-// Reorder imports
-
-use lorem;
-use ipsum;
-use dolor;
-use sit;
-
-fn foo() {
-    use C;
-    use B;
-    use A;
-
-    bar();
-
-    use F;
-    use E;
-    use D;
-}
diff --git a/tests/source/configs-reorder_imports_in_group-false.rs b/tests/source/configs-reorder_imports_in_group-false.rs
deleted file mode 100644 (file)
index 87711bb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-reorder_imports: true
-// rustfmt-reorder_imports_in_group: false
-// Reorder imports in group
-
-/// This comment should stay with `use std::mem;`
-use std::mem;
-use std::io;
-
-use lorem;
-/// This comment should stay with `use ipsum;`
-use ipsum;
-use dolor;
-use sit;
diff --git a/tests/source/configs-reorder_imports_in_group-true.rs b/tests/source/configs-reorder_imports_in_group-true.rs
deleted file mode 100644 (file)
index b5690b8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-reorder_imports: true
-// rustfmt-reorder_imports_in_group: true
-// Reorder imports in group
-
-/// This comment should stay with `use std::mem;`
-use std::mem;
-use std::io;
-
-use lorem;
-/// This comment should stay with `use ipsum;`
-use ipsum;
-use dolor;
-use sit;
diff --git a/tests/source/configs-same_line_attributes-false.rs b/tests/source/configs-same_line_attributes-false.rs
deleted file mode 100644 (file)
index a7983fd..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// rustfmt-same_line_attributes: false
-// Option to place attributes on the same line as fields and variants where possible
-
-enum Lorem {
-    #[ serde(skip_serializing) ]
-    Ipsum,
-    #[ serde(skip_serializing) ]
-    Dolor,
-    #[ serde(skip_serializing) ]
-    Amet,
-}
-
-struct Lorem {
-    #[ serde(rename = "Ipsum") ]
-    ipsum: usize,
-    #[ serde(rename = "Dolor") ]
-    dolor: usize,
-    #[ serde(rename = "Amet") ]
-    amet: usize,
-}
-
-// #1943
-pub struct Bzip2 {
-    # [ serde (rename = "level") ]
-     level: i32 ,
-}
diff --git a/tests/source/configs-same_line_attributes-true.rs b/tests/source/configs-same_line_attributes-true.rs
deleted file mode 100644 (file)
index bf79695..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// rustfmt-same_line_attributes: true
-// Option to place attributes on the same line as fields and variants where possible
-
-enum Lorem {
-    #[ serde(skip_serializing) ]
-    Ipsum,
-    #[ serde(skip_serializing) ]
-    Dolor,
-    #[ serde(skip_serializing) ]
-    Amet,
-}
-
-struct Lorem {
-    #[ serde(rename = "Ipsum") ]
-    ipsum: usize,
-    #[ serde(rename = "Dolor") ]
-    dolor: usize,
-    #[ serde(rename = "Amet") ]
-    amet: usize,
-}
diff --git a/tests/source/configs-space_before_colon-true.rs b/tests/source/configs-space_before_colon-true.rs
deleted file mode 100644 (file)
index 0a59760..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-space_before_colon: true
-// Space before colon
-
-fn lorem<T : Eq>(t : T) {
-    let ipsum: Dolor = sit;
-}
-
-const LOREM : Lorem = Lorem {
-    ipsum : dolor,
-    sit : amet,
-};
diff --git a/tests/source/configs-spaces_around_ranges-false.rs b/tests/source/configs-spaces_around_ranges-false.rs
deleted file mode 100644 (file)
index 3d431e4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_around_ranges: false
-// Spaces around ranges
-
-fn main() {
-    let lorem = 0..10;
-}
diff --git a/tests/source/configs-spaces_around_ranges-true.rs b/tests/source/configs-spaces_around_ranges-true.rs
deleted file mode 100644 (file)
index 8e9a311..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_around_ranges: true
-// Spaces around ranges
-
-fn main() {
-    let lorem = 0..10;
-}
diff --git a/tests/source/configs-spaces_within_parens_and_brackets-false.rs b/tests/source/configs-spaces_within_parens_and_brackets-false.rs
deleted file mode 100644 (file)
index 908373c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-spaces_within_parens_and_brackets: false
-// Spaces within parens and brackets
-
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-    let lorem: [usize; 2] = [ipsum, dolor];
-}
diff --git a/tests/source/configs-spaces_within_parens_and_brackets-true.rs b/tests/source/configs-spaces_within_parens_and_brackets-true.rs
deleted file mode 100644 (file)
index 2e3c92d..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-// rustfmt-spaces_within_parens_and_brackets: true
-// Spaces within parens and brackets
-
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-    let lorem: [usize; 2] = [ipsum, dolor];
-}
-
-enum E {
-    A(u32),
-    B(u32, u32),
-    C(u32, u32, u32),
-    D(),
-}
-
-struct TupleStruct0();
-struct TupleStruct1(u32);
-struct TupleStruct2(u32, u32);
-
-fn fooEmpty() {}
-
-fn foo(e: E, _: u32) -> (u32, u32) {
-    // Tuples
-    let t1 = ();
-    let t2 = (1,);
-    let t3 = (1, 2);
-
-    let ts0 = TupleStruct0();
-    let ts1 = TupleStruct1(1);
-    let ts2 = TupleStruct2(1, 2);
-
-    // Tuple pattern
-    let (a,b,c) = (1,2,3);
-
-    // Expressions
-    let x = (1 + 2) * (3);
-
-    // Function call
-    fooEmpty();
-    foo(1, 2);
-
-    // Pattern matching
-    match e {
-        A(_) => (),
-        B(_, _) => (),
-        C(..) => (),
-        D => (),
-    }
-
-    (1,2)
-}
-
-struct Foo<T> {
-    i: T,
-}
-
-struct Bar<T, E> {
-    i: T,
-    e: E,
-}
-
-struct Foo<'a> {
-    i: &'a str,
-}
-
-enum E<T> {
-    T(T),
-}
-
-enum E<T, S> {
-    T(T),
-    S(S),
-}
-
-fn foo<T>(a: T) {
-    foo::<u32>(10);
-}
-
-fn foo<T, E>(a: T, b: E) {
-    foo::<u32, str>(10, "bar");
-}
-
-fn foo<T: Send, E: Send>(a: T, b: E) {
-    foo::<u32, str>(10, "bar");
-
-    let opt: Option<u32>;
-    let res: Result<u32, String>;
-}
-
-fn foo<'a>(a: &'a str) {
-    foo("foo");
-}
-
-fn foo<'a, 'b>(a: &'a str, b: &'b str) {
-    foo("foo", "bar");
-}
-
-impl Foo {
-    fn bar() {
-        <Foo as Foo>::bar();
-    }
-}
-
-trait MyTrait<A, D> {}
-impl<A: Send, D: Send> MyTrait<A, D> for Foo {}
-
-fn foo() where for<'a> u32: 'a {}
-
-fn main() {
-    let arr: [i32; 5] = [1, 2, 3, 4, 5];
-    let arr: [i32; 500] = [0; 500];
-
-    let v = vec![1, 2, 3];
-    assert_eq!(arr, [1, 2, 3]);
-
-    let i = arr[0];
-
-    let slice = &arr[1..2];
-
-    let line100_________________________________________________________________________ = [1, 2];
-    let line101__________________________________________________________________________ = [1, 2];
-    let line102___________________________________________________________________________ = [1, 2];
-    let line103____________________________________________________________________________ = [1, 2];
-    let line104_____________________________________________________________________________ = [1, 2];
-
-    let line100_____________________________________________________________________ = vec![1, 2];
-    let line101______________________________________________________________________ = vec![1, 2];
-    let line102_______________________________________________________________________ = vec![1, 2];
-    let line103________________________________________________________________________ = vec![1, 2];
-    let line104_________________________________________________________________________ = vec![1, 2];
-}
-
-fn f(slice: &[i32]) {}
diff --git a/tests/source/configs-struct_field_align_threshold-20.rs b/tests/source/configs-struct_field_align_threshold-20.rs
deleted file mode 100644 (file)
index e68340b..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-// rustfmt-struct_field_align_threshold: 20
-// rustfmt-normalize_comments: true
-// rustfmt-wrap_comments: true
-// rustfmt-error_on_line_overflow: false
-
-struct Foo {
-    x: u32,
-    yy: u32, // comment
-    zzz: u32,
-}
-
-pub struct Bar {
-    x: u32,
-    yy: u32,
-    zzz: u32,
-
-    xxxxxxx: u32,
-}
-
-fn main() {
-    let foo = Foo {
-        x: 0,
-        yy: 1,
-        zzz: 2,
-    };
-
-    let bar = Bar {
-        x: 0,
-        yy: 1,
-        zzz: 2,
-
-        xxxxxxx: 3,
-    };
-}
-
-                                                                       /// A Doc comment
-#[AnAttribute]
-pub struct Foo {
-    #[rustfmt_skip]
-    f :   SomeType, // Comment beside a field
-    f: SomeType, // Comment beside a field
-    // Comment on a field
-    #[AnAttribute]
-    g: SomeOtherType,
-      /// A doc comment on a field
-    h: AThirdType,
-    pub i: TypeForPublicField
-}
-
-// #1029
-pub struct Foo {
-    #[doc(hidden)]
-    // This will NOT get deleted!
-    bar: String, // hi
-}
-
-// #1029
-struct X {
-    // `x` is an important number.
-    #[allow(unused)] // TODO: use
-    x: u32,
-}
-
-// #410
-#[allow(missing_docs)]
-pub struct Writebatch<K: Key> {
-    #[allow(dead_code)] //only used for holding the internal pointer
-    writebatch: RawWritebatch,
-    marker: PhantomData<K>,
-}
-
-struct Bar;
-
-struct NewType(Type,       OtherType);
-
-struct
-NewInt     <T: Copy>(pub i32, SomeType /* inline comment */, T /* sup */
-
-
-    );
-
-struct Qux<'a,
-           N: Clone + 'a,
-           E: Clone + 'a,
-           G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
-           W: Write + Copy>
-(
-    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
-    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
-    #[AnAttr]
-    // Comment
-    /// Testdoc
-    G,
-    pub W,
-);
-
-struct Tuple(/*Comment 1*/ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
-             /* Comment 2   */ BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,);
-
-// With a where clause and generics.
-pub struct Foo<'a, Y: Baz>
-    where X: Whatever
-{
-    f: SomeType, // Comment beside a field
-}
-
-struct Baz {
-
-    a: A,  // Comment A
-    b: B, // Comment B
-    c: C,   // Comment C
-
-}
-
-struct Baz {
-    a: A,  // Comment A
-
-    b: B, // Comment B
-
-
-
-
-    c: C,   // Comment C
-}
-
-struct Baz {
-
-    a: A,
-
-    b: B,
-    c: C,
-
-
-
-    
-    d: D
-
-}
-
-struct Baz
-{
-    // Comment A
-    a: A,
-    
-    // Comment B
-b: B,
-    // Comment C
-      c: C,}
-
-// Will this be a one-liner?
-struct Tuple(
-    A, //Comment
-    B
-);
-
-pub struct State<F: FnMut() -> time::Timespec> { now: F }
-
-pub struct State<F: FnMut() -> ()> { now: F }
-
-pub struct State<F: FnMut()> { now: F }
-
-struct Palette { /// A map of indices in the palette to a count of pixels in approximately that color
-                    foo: i32}
-
-// Splitting a single line comment into a block previously had a misalignment
-// when the field had attributes
-struct FieldsWithAttributes {
-    // Pre Comment
-    #[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
-    //Another pre comment
-    #[attr1]
-    #[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
-}
-
-struct Deep {
-    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep: node::Handle<IdRef<'id, Node<K, V>>,
-                                                     Type,
-                                                     NodeType>,
-}
-
-struct Foo<T>(T);
-struct Foo<T>(T) where T: Copy, T: Eq;
-struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU);
-struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT) where T: PartialEq;
-struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT) where T: PartialEq;
-struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU) where T: PartialEq;
-struct Foo<T>(TTTTTTTTTTTTTTTTT, // Foo
-              UUUUUUUUUUUUUUUUUUUUUUUU /* Bar */,
-              // Baz
-              TTTTTTTTTTTTTTTTTTT,
-              // Qux (FIXME #572 - doc comment)
-              UUUUUUUUUUUUUUUUUUU);
-
-mod m {
-    struct X<T> where T: Sized {
-        a: T,
-    }
-}
-
-struct Foo<T>(TTTTTTTTTTTTTTTTTTT,
-              /// Qux
-    UUUUUUUUUUUUUUUUUUU);
-
-struct Issue677 {
-    pub ptr: *const libc::c_void,
-    pub trace: fn(  obj: 
-          *const libc::c_void, tracer   : *mut   JSTracer   ),
-}
-
-struct Foo {}
-struct Foo {
-    }
-struct Foo {
-    // comment
-    }
-struct Foo {
-    // trailing space ->    
-
-
-    }
-struct Foo { /* comment */ }
-struct Foo( /* comment */ );
-
-struct LongStruct {
-    a: A,
-    the_quick_brown_fox_jumps_over_the_lazy_dog:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
-}
-
-struct Deep {
-    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep: node::Handle<IdRef<'id, Node<Key, Value>>,
-                                                                         Type,
-                                                                         NodeType>,
-}
-
-struct Foo<C=()>(String);
-
-// #1364
-fn foo() {
-    convex_shape.set_point(0, &Vector2f { x: 400.0, y: 100.0 });
-    convex_shape.set_point(1, &Vector2f { x: 500.0, y: 70.0 });
-    convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
-    convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
-}
-
-fn main() {
-    let x = Bar;
-
-    // Comment
-    let y = Foo {a: x };
-
-    Foo { a: foo() /* comment*/, /* comment*/ b: bar(), ..something };
-
-    Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b(), };
-
-    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b(), };
-
-    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
-        // Comment
-        a: foo(), // Comment
-        // Comment
-        b: bar(), // Comment
-    };
-
-    Foo { a:Bar,
-          b:f() };
-
-    Quux { x: if cond { bar(); }, y: baz() };
-
-    A { 
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.
-    first: item(),
-        // Praesent et diam eget libero egestas mattis sit amet vitae augue.
-        // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
-        second: Item
-    };
-
-    Some(Data::MethodCallData(MethodCallData {
-        span: sub_span.unwrap(),
-        scope: self.enclosing_scope(id),
-        ref_id: def_id,
-        decl_id: Some(decl_id),
-    }));
-
-    Diagram { /*                 o        This graph demonstrates how                  
-               *                / \       significant whitespace is           
-               *               o   o      preserved.  
-               *              /|\   \
-               *             o o o   o */
-              graph: G, }
-}
-
-fn matcher() {
-    TagTerminatedByteMatcher {
-        matcher: ByteMatcher {
-        pattern: b"<HTML",
-        mask: b"\xFF\xDF\xDF\xDF\xDF\xFF",
-    },
-    };
-}
-
-fn issue177() {
-    struct Foo<T> { memb: T }
-    let foo = Foo::<i64> { memb: 10 };
-}
-
-fn issue201() {
-    let s = S{a:0, ..  b};
-}
-
-fn issue201_2() {
-    let s = S{a: S2{    .. c}, ..  b};
-}
-
-fn issue278() {
-    let s = S {
-        a: 0,
-        //       
-        b: 0,
-    };
-    let s1 = S {
-        a: 0,
-        // foo
-        //      
-        // bar
-        b: 0,
-    };
-}
-
-fn struct_exprs() {
-    Foo
-    { a :  1, b:f( 2)};
-    Foo{a:1,b:f(2),..g(3)};
-    LoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongStruct { ..base };
-    IntrinsicISizesContribution { content_intrinsic_sizes: IntrinsicISizes { minimum_inline_size: 0, }, };
-}
-
-fn issue123() {
-    Foo { a: b, c: d, e: f };
-
-    Foo { a: bb, c: dd, e: ff };
-
-    Foo { a: ddddddddddddddddddddd, b: cccccccccccccccccccccccccccccccccccccc };
-}
-
-fn issue491() {
-    Foo {
-        guard: None,
-        arm: 0, // Comment
-    };
-
-    Foo {
-        arm: 0, // Comment
-    };
-
-    Foo { a: aaaaaaaaaa, b: bbbbbbbb, c: cccccccccc, d: dddddddddd, /* a comment */
-      e: eeeeeeeee };
-}
-
-fn issue698() {
-    Record {
-        ffffffffffffffffffffffffffields: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-    };
-    Record {
-        ffffffffffffffffffffffffffields: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-    }
-}
-
-fn issue835() {
-    MyStruct {};
-    MyStruct { /* a comment */ };
-    MyStruct {
-        // Another comment
-    };
-    MyStruct {}
-}
-
-fn field_init_shorthand() {
-    MyStruct { x, y, z };
-    MyStruct { x, y, z, .. base };
-    Foo { aaaaaaaaaa, bbbbbbbb, cccccccccc, dddddddddd, /* a comment */
-        eeeeeeeee };
-    Record { ffffffffffffffffffffffffffieldsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa };
-}
diff --git a/tests/source/configs-struct_lit_indent-block.rs b/tests/source/configs-struct_lit_indent-block.rs
deleted file mode 100644 (file)
index 47a6994..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Block
-// Struct literal-style
-
-fn main() {
-    let lorem = Lorem { ipsum: dolor, sit: amet };
-}
diff --git a/tests/source/configs-struct_lit_indent-visual.rs b/tests/source/configs-struct_lit_indent-visual.rs
deleted file mode 100644 (file)
index 45538e7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Struct literal-style
-
-fn main() {
-    let lorem = Lorem { ipsum: dolor, sit: amet };
-}
diff --git a/tests/source/configs-struct_lit_single_line-false.rs b/tests/source/configs-struct_lit_single_line-false.rs
deleted file mode 100644 (file)
index 17cad8d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-struct_lit_single_line: false
-// Struct literal multiline-style
-
-fn main() {
-    let lorem = Lorem { ipsum: dolor, sit: amet };
-}
diff --git a/tests/source/configs-tab_spaces-2.rs b/tests/source/configs-tab_spaces-2.rs
deleted file mode 100644 (file)
index 5c2667b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-tab_spaces: 2
-// rustfmt-max_width: 30
-// rustfmt-indent_style: Block
-// Tab spaces
-
-fn lorem() {
-let ipsum = dolor();
-let sit = vec![
-"amet", "consectetur", "adipiscing", "elit."
-];
-}
diff --git a/tests/source/configs-tab_spaces-4.rs b/tests/source/configs-tab_spaces-4.rs
deleted file mode 100644 (file)
index da61bbd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-tab_spaces: 4
-// rustfmt-max_width: 30
-// rustfmt-indent_style: Block
-// Tab spaces
-
-fn lorem() {
-let ipsum = dolor();
-let sit = vec![
-"amet", "consectetur", "adipiscing", "elit."
-];
-}
diff --git a/tests/source/configs-trailing_comma-always.rs b/tests/source/configs-trailing_comma-always.rs
deleted file mode 100644 (file)
index 57e874c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-trailing_comma: Always
-// Trailing comma
-
-fn main() {
-    let Lorem { ipsum, dolor, sit, } = amet;
-    let Lorem { ipsum, dolor, sit, amet, consectetur, adipiscing } = elit;
-}
diff --git a/tests/source/configs-trailing_comma-never.rs b/tests/source/configs-trailing_comma-never.rs
deleted file mode 100644 (file)
index 4da3b99..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// rustfmt-trailing_comma: Never
-// Trailing comma
-
-fn main() {
-    let Lorem { ipsum, dolor, sit, } = amet;
-    let Lorem { ipsum, dolor, sit, amet, consectetur, adipiscing } = elit;
-
-    // #1544
-    if let VrMsg::ClientReply {request_num: reply_req_num, value, ..} = msg {
-        let _ = safe_assert_eq!(reply_req_num, request_num, op);
-        return Ok((request_num, op, value));
-    }
-
-    // #1710
-    pub struct FileInput {
-        input: StringInput,
-        file_name: OsString,
-    }
-    match len {
-        Some(len) => Ok(new(self.input, self.pos + len)),
-        None => Err(self),
-    }
-}
diff --git a/tests/source/configs-trailing_comma-vertical.rs b/tests/source/configs-trailing_comma-vertical.rs
deleted file mode 100644 (file)
index c903e82..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-trailing_comma: Vertical
-// Trailing comma
-
-fn main() {
-    let Lorem { ipsum, dolor, sit, } = amet;
-    let Lorem { ipsum, dolor, sit, amet, consectetur, adipiscing } = elit;
-}
diff --git a/tests/source/configs-type_punctuation_density-compressed.rs b/tests/source/configs-type_punctuation_density-compressed.rs
deleted file mode 100644 (file)
index 6e16e61..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-type_punctuation_density: Compressed
-// Type punctuation density
-
-fn lorem<Ipsum:Dolor+Sit=Amet>() {
-    // body
-}
diff --git a/tests/source/configs-type_punctuation_density-wide.rs b/tests/source/configs-type_punctuation_density-wide.rs
deleted file mode 100644 (file)
index 1fcdddf..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-type_punctuation_density: Wide
-// Type punctuation density
-
-fn lorem<Ipsum:Dolor+Sit=Amet>() {
-    // body
-}
diff --git a/tests/source/configs-use_try_shorthand-false.rs b/tests/source/configs-use_try_shorthand-false.rs
deleted file mode 100644 (file)
index de7f8b4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-use_try_shorthand: false
-// Use try! shorthand
-
-fn main() {
-    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
-}
diff --git a/tests/source/configs-use_try_shorthand-true.rs b/tests/source/configs-use_try_shorthand-true.rs
deleted file mode 100644 (file)
index 9015ec4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-use_try_shorthand: true
-// Use try! shorthand
-
-fn main() {
-    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
-}
diff --git a/tests/source/configs-where_pred_indent-block.rs b/tests/source/configs-where_pred_indent-block.rs
deleted file mode 100644 (file)
index 450491f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Block
-// Where predicate indent
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
-    // body
-}
diff --git a/tests/source/configs-where_pred_indent-visual.rs b/tests/source/configs-where_pred_indent-visual.rs
deleted file mode 100644 (file)
index 055806b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Where predicate indent
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
-    // body
-}
diff --git a/tests/source/configs-where_single_line-true.rs b/tests/source/configs-where_single_line-true.rs
deleted file mode 100644 (file)
index daaab86..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// rustfmt-where_single_line: true
-// Where style
-
-
-fn lorem_two_items<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Lorem: Eq {
-    // body
-}
-
-fn lorem_multi_line<Ipsum, Dolor, Sit, Amet>(
-    a: Aaaaaaaaaaaaaaa,
-    b: Bbbbbbbbbbbbbbbb,
-    c: Ccccccccccccccccc,
-    d: Ddddddddddddddddddddddddd,
-    e: Eeeeeeeeeeeeeeeeeee,
-) -> T
-where
-    Ipsum: Eq,
-{
-    // body
-}
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq {
-    // body
-}
diff --git a/tests/source/configs-where_style-default.rs b/tests/source/configs-where_style-default.rs
deleted file mode 100644 (file)
index f08f5c6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Visual
-// Where style
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
-    // body
-}
diff --git a/tests/source/configs-where_style-rfc.rs b/tests/source/configs-where_style-rfc.rs
deleted file mode 100644 (file)
index 012840b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-indent_style: Block
-// Where style
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
-    // body
-}
diff --git a/tests/source/configs-wrap_comments-false.rs b/tests/source/configs-wrap_comments-false.rs
deleted file mode 100644 (file)
index 48ecd88..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// rustfmt-wrap_comments: false
-// rustfmt-max_width: 50
-// rustfmt-error_on_line_overflow: false
-// Wrap comments
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-}
diff --git a/tests/source/configs-wrap_comments-true.rs b/tests/source/configs-wrap_comments-true.rs
deleted file mode 100644 (file)
index 39a79a4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// rustfmt-wrap_comments: true
-// rustfmt-max_width: 50
-// Wrap comments
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-}
-
-fn code_block() {
-    // ```rust
-    // let x = 3;
-    //
-    // println!("x = {}", x);
-    // ```
-}
diff --git a/tests/source/configs/array_indent/block.rs b/tests/source/configs/array_indent/block.rs
new file mode 100644 (file)
index 0000000..8404f65
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Block
+// Array layout
+
+fn main() {
+    let lorem = vec!["ipsum","dolor","sit","amet","consectetur","adipiscing","elit"];
+}
diff --git a/tests/source/configs/array_indent/visual.rs b/tests/source/configs/array_indent/visual.rs
new file mode 100644 (file)
index 0000000..05bbf00
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Array layout
+
+fn main() {
+    let lorem = vec!["ipsum","dolor","sit","amet","consectetur","adipiscing","elit"];
+}
diff --git a/tests/source/configs/blank_lines_lower_bound/1.rs b/tests/source/configs/blank_lines_lower_bound/1.rs
new file mode 100644 (file)
index 0000000..c6058a5
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-blank_lines_lower_bound: 1
+
+fn foo() {}
+fn bar() {}
+// comment
+fn foobar() {}
+
+fn foo1() {}
+fn bar1() {}
+
+// comment
+
+fn foobar1() {}
diff --git a/tests/source/configs/chain_indent/block.rs b/tests/source/configs/chain_indent/block.rs
new file mode 100644 (file)
index 0000000..41d9146
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Block
+// Chain indent
+
+fn main() {
+    let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elite();
+}
diff --git a/tests/source/configs/chain_indent/visual.rs b/tests/source/configs/chain_indent/visual.rs
new file mode 100644 (file)
index 0000000..b749487
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Chain indent
+
+fn main() {
+    let lorem = ipsum.dolor().sit().amet().consectetur().adipiscing().elite();
+}
diff --git a/tests/source/configs/comment_width/above.rs b/tests/source/configs/comment_width/above.rs
new file mode 100644 (file)
index 0000000..36187ce
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-comment_width: 40
+// rustfmt-wrap_comments: true
+// Comment width
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+}
diff --git a/tests/source/configs/comment_width/below.rs b/tests/source/configs/comment_width/below.rs
new file mode 100644 (file)
index 0000000..abbc593
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-comment_width: 80
+// rustfmt-wrap_comments: true
+// Comment width
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+}
diff --git a/tests/source/configs/comment_width/ignore.rs b/tests/source/configs/comment_width/ignore.rs
new file mode 100644 (file)
index 0000000..c86e71c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-comment_width: 40
+// rustfmt-wrap_comments: false
+// Comment width
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+}
diff --git a/tests/source/configs/condense_wildcard_suffices/false.rs b/tests/source/configs/condense_wildcard_suffices/false.rs
new file mode 100644 (file)
index 0000000..3b967f3
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-condense_wildcard_suffixes: false
+// Condense wildcard suffixes
+
+fn main() {
+    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+}
diff --git a/tests/source/configs/condense_wildcard_suffices/true.rs b/tests/source/configs/condense_wildcard_suffices/true.rs
new file mode 100644 (file)
index 0000000..3798a6b
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-condense_wildcard_suffixes: true
+// Condense wildcard suffixes
+
+fn main() {
+    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+}
diff --git a/tests/source/configs/control_brace_style/always_next_line.rs b/tests/source/configs/control_brace_style/always_next_line.rs
new file mode 100644 (file)
index 0000000..c4ddad9
--- /dev/null
@@ -0,0 +1,10 @@
+// rustfmt-control_brace_style: AlwaysNextLine
+// Control brace style
+
+fn main() {
+    if lorem { println!("ipsum!"); } else { println!("dolor!"); }
+    match magi {
+        Homura => "Akemi",
+        Madoka => "Kaname",
+    }
+}
diff --git a/tests/source/configs/control_brace_style/always_same_line.rs b/tests/source/configs/control_brace_style/always_same_line.rs
new file mode 100644 (file)
index 0000000..a9c699d
--- /dev/null
@@ -0,0 +1,10 @@
+// rustfmt-control_brace_style: AlwaysSameLine
+// Control brace style
+
+fn main() {
+    if lorem { println!("ipsum!"); } else { println!("dolor!"); }
+    match magi {
+        Homura => "Akemi",
+        Madoka => "Kaname",
+    }
+}
diff --git a/tests/source/configs/control_brace_style/closing_next_line.rs b/tests/source/configs/control_brace_style/closing_next_line.rs
new file mode 100644 (file)
index 0000000..1a74a28
--- /dev/null
@@ -0,0 +1,10 @@
+// rustfmt-control_brace_style: ClosingNextLine
+// Control brace style
+
+fn main() {
+    if lorem { println!("ipsum!"); } else { println!("dolor!"); }
+    match magi {
+        Homura => "Akemi",
+        Madoka => "Kaname",
+    }
+}
diff --git a/tests/source/configs/disable_all_formatting/false.rs b/tests/source/configs/disable_all_formatting/false.rs
new file mode 100644 (file)
index 0000000..834ca7a
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-disable_all_formatting: false
+// Disable all formatting
+
+fn main() {
+    if lorem{println!("ipsum!");}else{println!("dolor!");}
+}
diff --git a/tests/source/configs/disable_all_formatting/true.rs b/tests/source/configs/disable_all_formatting/true.rs
new file mode 100644 (file)
index 0000000..56955bf
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-disable_all_formatting: true
+// Disable all formatting
+
+fn main() {
+    iflorem{println!("ipsum!");}else{println!("dolor!");}
+}
diff --git a/tests/source/configs/empty_item_single_line/false.rs b/tests/source/configs/empty_item_single_line/false.rs
new file mode 100644 (file)
index 0000000..8fa74f2
--- /dev/null
@@ -0,0 +1,17 @@
+// rustfmt-empty_item_single_line: false
+// Empty impl on single line
+
+impl Lorem {
+
+}
+
+impl Ipsum {
+
+}
+
+fn lorem() {
+}
+
+fn lorem() {
+
+}
diff --git a/tests/source/configs/empty_item_single_line/true.rs b/tests/source/configs/empty_item_single_line/true.rs
new file mode 100644 (file)
index 0000000..02e703d
--- /dev/null
@@ -0,0 +1,17 @@
+// rustfmt-empty_item_single_line: true
+// Empty impl on single line
+
+impl Lorem {
+
+}
+
+impl Ipsum {
+
+}
+
+fn lorem() {
+}
+
+fn lorem() {
+
+}
diff --git a/tests/source/configs/error_on_line_overflow/false.rs b/tests/source/configs/error_on_line_overflow/false.rs
new file mode 100644 (file)
index 0000000..fa70ae7
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-error_on_line_overflow: false
+// Error on line overflow
+
+fn main() {
+    let lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit_lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit;
+}
diff --git a/tests/source/configs/fn_args_density/compressed.rs b/tests/source/configs/fn_args_density/compressed.rs
new file mode 100644 (file)
index 0000000..86c0b42
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-fn_args_density: Compressed
+// Function arguments density
+
+trait Lorem {
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
+        // body
+    }
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) {
+        // body
+    }
+}
diff --git a/tests/source/configs/fn_args_density/tall.rs b/tests/source/configs/fn_args_density/tall.rs
new file mode 100644 (file)
index 0000000..fc400e1
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-fn_args_density: Tall
+// Function arguments density
+
+trait Lorem {
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
+        // body
+    }
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) {
+        // body
+    }
+}
diff --git a/tests/source/configs/fn_args_density/vertical.rs b/tests/source/configs/fn_args_density/vertical.rs
new file mode 100644 (file)
index 0000000..20b1427
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-fn_args_density: Vertical
+// Function arguments density
+
+trait Lorem {
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
+        // body
+    }
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur, adipiscing: Adipiscing, elit: Elit) {
+        // body
+    }
+}
diff --git a/tests/source/configs/fn_args_indent/block.rs b/tests/source/configs/fn_args_indent/block.rs
new file mode 100644 (file)
index 0000000..4d2d280
--- /dev/null
@@ -0,0 +1,26 @@
+// rustfmt-indent_style: Block
+// Function arguments layout
+
+fn lorem() {}
+
+fn lorem(ipsum: usize) {}
+
+fn lorem(ipsum: usize, dolor: usize, sit: usize, amet: usize, consectetur: usize, adipiscing: usize, elit: usize) {
+    // body
+}
+
+// #1441
+extern "system" {
+    pub fn GetConsoleHistoryInfo(console_history_info: *mut ConsoleHistoryInfo) -> Boooooooooooooool;
+}
+
+// rustfmt should not add trailing comma for variadic function. See #1623.
+extern "C" {
+    pub fn variadic_fn(first_parameter: FirstParameterType,
+                       second_parameter: SecondParameterType,
+                       ...);
+}
+
+// #1652
+fn deconstruct(foo: Bar) -> (SocketAddr, Header, Method, RequestUri, HttpVersion, AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {
+}
diff --git a/tests/source/configs/fn_args_indent/visual.rs b/tests/source/configs/fn_args_indent/visual.rs
new file mode 100644 (file)
index 0000000..5aa28a6
--- /dev/null
@@ -0,0 +1,32 @@
+// rustfmt-indent_style: Visual
+// Function arguments layout
+
+fn lorem() {}
+
+fn lorem(ipsum: usize) {}
+
+fn lorem(ipsum: usize, dolor: usize, sit: usize, amet: usize, consectetur: usize, adipiscing: usize, elit: usize) {
+    // body
+}
+
+// #1922
+extern "C" {
+    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
+            uplo: c_char,
+                n: lapack_int,
+        nrhs: lapack_int,
+        a: *const lapack_complex_float,
+                    lda: lapack_int, ipiv: *const lapack_int,
+        b: *mut lapack_complex_float,
+            ldb: lapack_int
+    )-> lapack_int;
+
+    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
+            uplo: c_char,
+                n: lapack_int,
+        nrhs: lapack_int,
+                    lda: lapack_int, ipiv: *const lapack_int,
+        b: *mut lapack_complex_float,
+            ldb: lapack_int
+    ) -> lapack_int;
+}
diff --git a/tests/source/configs/fn_brace_style/always_next_line.rs b/tests/source/configs/fn_brace_style/always_next_line.rs
new file mode 100644 (file)
index 0000000..d3bd9ac
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-brace_style: AlwaysNextLine
+// Function brace style
+
+fn lorem() {
+    // body
+}
+
+fn lorem(ipsum: usize) {
+    // body
+}
+
+fn lorem<T>(ipsum: T) where T: Add + Sub + Mul + Div {
+    // body
+}
diff --git a/tests/source/configs/fn_brace_style/prefer_same_line.rs b/tests/source/configs/fn_brace_style/prefer_same_line.rs
new file mode 100644 (file)
index 0000000..78a4495
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-brace_style: PreferSameLine
+// Function brace style
+
+fn lorem() {
+    // body
+}
+
+fn lorem(ipsum: usize) {
+    // body
+}
+
+fn lorem<T>(ipsum: T) where T: Add + Sub + Mul + Div {
+    // body
+}
diff --git a/tests/source/configs/fn_brace_style/same_line_where.rs b/tests/source/configs/fn_brace_style/same_line_where.rs
new file mode 100644 (file)
index 0000000..3b78932
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-brace_style: SameLineWhere
+// Function brace style
+
+fn lorem() {
+    // body
+}
+
+fn lorem(ipsum: usize) {
+    // body
+}
+
+fn lorem<T>(ipsum: T) where T: Add + Sub + Mul + Div {
+    // body
+}
diff --git a/tests/source/configs/fn_call_indent/block.rs b/tests/source/configs/fn_call_indent/block.rs
new file mode 100644 (file)
index 0000000..c82b6b8
--- /dev/null
@@ -0,0 +1,133 @@
+// rustfmt-indent_style: Block
+// Function call style
+
+fn main() {
+    lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
+    // #1501
+    let hyper = Arc::new(Client::with_connector(HttpsConnector::new(TlsClient::new())));
+
+    // chain
+    let x = yooooooooooooo.fooooooooooooooo.baaaaaaaaaaaaar(hello, world);
+
+    // #1380
+    {
+        {
+            let creds = self.client
+                .client_credentials(&self.config.auth.oauth2.id, &self.config.auth.oauth2.secret)?;
+        }
+    }
+
+    // nesting macro and function call
+    try!(foo(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx));
+    try!(foo(try!(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)));
+}
+
+// #1521
+impl Foo {
+    fn map_pixel_to_coords(&self, point: &Vector2i, view: &View) -> Vector2f {
+        unsafe {
+            Vector2f::from_raw(ffi::sfRenderTexture_mapPixelToCoords(self.render_texture, point.raw(), view.raw()))
+        }
+    }
+}
+
+fn issue1420() {
+    given(
+        r#"
+        # Getting started
+        ...
+    "#,
+    )
+        .running(waltz)
+}
+
+// #1563
+fn query(conn: &Connection) -> Result<()> {
+    conn.query_row(
+        r#"
+            SELECT title, date
+            FROM posts,
+            WHERE DATE(date) = $1
+        "#,
+        &[],
+        |row| {
+            Post {
+                title: row.get(0),
+                date: row.get(1),
+            }
+        },
+    )?;
+
+    Ok(())
+}
+
+// #1449
+fn future_rayon_wait_1_thread() {
+    // run with only 1 worker thread; this would deadlock if we couldn't make progress
+    let mut result = None;
+    ThreadPool::new(Configuration::new().num_threads(1))
+        .unwrap()
+        .install(
+            || {
+                scope(
+                    |s| {
+                        use std::sync::mpsc::channel;
+                        let (tx, rx) = channel();
+                        let a = s.spawn_future(lazy(move || Ok::<usize, ()>(rx.recv().unwrap())));
+                        //                          ^^^^ FIXME: why is this needed?
+                        let b = s.spawn_future(a.map(|v| v + 1));
+                        let c = s.spawn_future(b.map(|v| v + 1));
+                        s.spawn(move |_| tx.send(20).unwrap());
+                        result = Some(c.rayon_wait().unwrap());
+                    },
+                );
+            },
+        );
+    assert_eq!(result, Some(22));
+}
+
+// #1494
+impl Cursor {
+    fn foo() {
+        self.cur_type()
+            .num_template_args()
+            .or_else(|| {
+                let n: c_int = unsafe { clang_Cursor_getNumTemplateArguments(self.x) };
+
+                if n >= 0 {
+                    Some(n as u32)
+                } else {
+                    debug_assert_eq!(n, -1);
+                    None
+                }
+            })
+            .or_else(|| {
+                let canonical = self.canonical();
+                if canonical != *self {
+                    canonical.num_template_args()
+                } else {
+                    None
+                }
+            });
+    }
+}
+
+fn issue1581() {
+    bootstrap.checks.register(
+        "PERSISTED_LOCATIONS",
+        move || if locations2.0.inner_mut.lock().poisoned {
+            Check::new(
+                State::Error,
+                "Persisted location storage is poisoned due to a write failure",
+            )
+        } else {
+            Check::new(State::Healthy, "Persisted location storage is healthy")
+        },
+    );
+}
+
+fn issue1651() {
+    {
+        let type_list: Vec<_> = try_opt!(types.iter().map(|ty| ty.rewrite(context, shape)).collect());
+    }
+}
diff --git a/tests/source/configs/fn_call_indent/block_trailing_comma.rs b/tests/source/configs/fn_call_indent/block_trailing_comma.rs
new file mode 100644 (file)
index 0000000..c907ec5
--- /dev/null
@@ -0,0 +1,8 @@
+// rustfmt-error_on_line_overflow: false
+// rustfmt-indent_style: Block
+
+// rustfmt should not add trailing comma when rewriting macro. See #1528.
+fn a() {
+    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
+    foo(a, oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt());
+}
diff --git a/tests/source/configs/fn_call_indent/visual.rs b/tests/source/configs/fn_call_indent/visual.rs
new file mode 100644 (file)
index 0000000..9a679d6
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Function call style
+
+fn main() {
+    lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit");
+}
diff --git a/tests/source/configs/fn_call_indent/visual_trailing_comma.rs b/tests/source/configs/fn_call_indent/visual_trailing_comma.rs
new file mode 100644 (file)
index 0000000..9738d39
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-error_on_line_overflow: false
+// rustfmt-indent_style: Visual
+
+// rustfmt should not add trailing comma when rewriting macro. See #1528.
+fn a() {
+    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
+}
diff --git a/tests/source/configs/fn_single_line/false.rs b/tests/source/configs/fn_single_line/false.rs
new file mode 100644 (file)
index 0000000..3d092f0
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-fn_single_line: false
+// Single-expression function on single line
+
+fn lorem() -> usize {
+    42
+}
+
+fn lorem() -> usize {
+    let ipsum = 42;
+    ipsum
+}
diff --git a/tests/source/configs/fn_single_line/true.rs b/tests/source/configs/fn_single_line/true.rs
new file mode 100644 (file)
index 0000000..3cb0fde
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-fn_single_line: true
+// Single-expression function on single line
+
+fn lorem() -> usize {
+    42
+}
+
+fn lorem() -> usize {
+    let ipsum = 42;
+    ipsum
+}
diff --git a/tests/source/configs/force_explicit_abi/false.rs b/tests/source/configs/force_explicit_abi/false.rs
new file mode 100644 (file)
index 0000000..3c48f8e
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-force_explicit_abi: false
+// Force explicit abi
+
+extern {
+    pub static lorem: c_int;
+}
diff --git a/tests/source/configs/force_explicit_abi/true.rs b/tests/source/configs/force_explicit_abi/true.rs
new file mode 100644 (file)
index 0000000..e5ff6cf
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-force_explicit_abi: true
+// Force explicit abi
+
+extern {
+    pub static lorem: c_int;
+}
diff --git a/tests/source/configs/force_multiline_block/false.rs b/tests/source/configs/force_multiline_block/false.rs
new file mode 100644 (file)
index 0000000..b97e348
--- /dev/null
@@ -0,0 +1,22 @@
+// rustfmt-force_multiline_blocks: false
+// Option forces multiline match arm and closure bodies to be wrapped in a block
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            if ipsum {
+                println!("dolor");
+            }
+        }
+        Lorem::Dolor => println!("amet"),
+    }
+}
+
+fn main() {
+    result.and_then(|maybe_value| {
+        match maybe_value {
+            None => Err("oops"),
+            Some(value) => Ok(1),
+        }
+    });
+}
diff --git a/tests/source/configs/force_multiline_block/true.rs b/tests/source/configs/force_multiline_block/true.rs
new file mode 100644 (file)
index 0000000..db9d3de
--- /dev/null
@@ -0,0 +1,18 @@
+// rustfmt-force_multiline_blocks: true
+// Option forces multiline match arm and closure bodies to be wrapped in a block
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => if ipsum {
+            println!("dolor");
+        },
+        Lorem::Dolor => println!("amet"),
+    }
+}
+
+fn main() {
+    result.and_then(|maybe_value| match maybe_value {
+        None => Err("oops"),
+        Some(value) => Ok(1),
+    });
+}
diff --git a/tests/source/configs/format_strings/false.rs b/tests/source/configs/format_strings/false.rs
new file mode 100644 (file)
index 0000000..ecca0d7
--- /dev/null
@@ -0,0 +1,8 @@
+// rustfmt-format_strings: false
+// rustfmt-max_width: 50
+// rustfmt-error_on_line_overflow: false
+// Force format strings
+
+fn main() {
+    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
+}
diff --git a/tests/source/configs/format_strings/true.rs b/tests/source/configs/format_strings/true.rs
new file mode 100644 (file)
index 0000000..3373144
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-format_strings: true
+// rustfmt-max_width: 50
+// Force format strings
+
+fn main() {
+    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
+}
diff --git a/tests/source/configs/generics_indent/block.rs b/tests/source/configs/generics_indent/block.rs
new file mode 100644 (file)
index 0000000..2cf17be
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Block
+// Generics indent
+
+fn lorem<Ipsum: Eq = usize, Dolor: Eq = usize, Sit: Eq = usize, Amet: Eq = usize, Adipiscing: Eq = usize, Consectetur: Eq = usize, Elit: Eq = usize>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, adipiscing: Adipiscing, consectetur: Consectetur, elit: Elit) -> T {
+    // body
+}
diff --git a/tests/source/configs/generics_indent/visual.rs b/tests/source/configs/generics_indent/visual.rs
new file mode 100644 (file)
index 0000000..1f910d3
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Generics indent
+
+fn lorem<Ipsum: Eq = usize, Dolor: Eq = usize, Sit: Eq = usize, Amet: Eq = usize, Adipiscing: Eq = usize, Consectetur: Eq = usize, Elit: Eq = usize>(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, adipiscing: Adipiscing, consectetur: Consectetur, elit: Elit) -> T {
+    // body
+}
diff --git a/tests/source/configs/hard_tabs/false.rs b/tests/source/configs/hard_tabs/false.rs
new file mode 100644 (file)
index 0000000..bf92162
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-hard_tabs: false
+// Hard tabs
+
+fn lorem() -> usize {
+42 // spaces before 42
+}
diff --git a/tests/source/configs/hard_tabs/true.rs b/tests/source/configs/hard_tabs/true.rs
new file mode 100644 (file)
index 0000000..738922a
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-hard_tabs: true
+// Hard tabs
+
+fn lorem() -> usize {
+42 // spaces before 42
+}
diff --git a/tests/source/configs/item_brace_style/always_next_line.rs b/tests/source/configs/item_brace_style/always_next_line.rs
new file mode 100644 (file)
index 0000000..0cc19b3
--- /dev/null
@@ -0,0 +1,20 @@
+// rustfmt-brace_style: AlwaysNextLine
+// Item brace style
+
+enum Foo {}
+
+struct Bar {}
+
+struct Lorem {
+    ipsum: bool,
+}
+
+struct Dolor<T> where T: Eq {
+    sit: T,
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {}
+}
diff --git a/tests/source/configs/item_brace_style/prefer_same_line.rs b/tests/source/configs/item_brace_style/prefer_same_line.rs
new file mode 100644 (file)
index 0000000..4412bc8
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-brace_style: PreferSameLine
+// Item brace style
+
+struct Lorem {
+    ipsum: bool,
+}
+
+struct Dolor<T> where T: Eq {
+    sit: T,
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {}
+}
diff --git a/tests/source/configs/item_brace_style/same_line_where.rs b/tests/source/configs/item_brace_style/same_line_where.rs
new file mode 100644 (file)
index 0000000..b8e6914
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-brace_style: SameLineWhere
+// Item brace style
+
+struct Lorem {
+    ipsum: bool,
+}
+
+struct Dolor<T> where T: Eq {
+    sit: T,
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {}
+}
diff --git a/tests/source/configs/match_arm_blocks/false.rs b/tests/source/configs/match_arm_blocks/false.rs
new file mode 100644 (file)
index 0000000..53e37e1
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_arm_blocks: false
+// Wrap match-arms
+
+fn main() {
+    match lorem {
+        true => foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
+        false => {
+            println!("{}", sit)
+        }
+    }
+}
diff --git a/tests/source/configs/match_arm_blocks/true.rs b/tests/source/configs/match_arm_blocks/true.rs
new file mode 100644 (file)
index 0000000..a452b13
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_arm_blocks: true
+// Wrap match-arms
+
+fn main() {
+    match lorem {
+        true => foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
+        false => {
+            println!("{}", sit)
+        }
+    }
+}
diff --git a/tests/source/configs/match_block_trailing_comma/false.rs b/tests/source/configs/match_block_trailing_comma/false.rs
new file mode 100644 (file)
index 0000000..70e0295
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_block_trailing_comma: false
+// Match block trailing comma
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            println!("ipsum");
+        }
+        Lorem::Dolor => println!("dolor"),
+    }
+}
diff --git a/tests/source/configs/match_block_trailing_comma/true.rs b/tests/source/configs/match_block_trailing_comma/true.rs
new file mode 100644 (file)
index 0000000..b9af3d4
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_block_trailing_comma: true
+// Match block trailing comma
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            println!("ipsum");
+        }
+        Lorem::Dolor => println!("dolor"),
+    }
+}
diff --git a/tests/source/configs/merge_derives/true.rs b/tests/source/configs/merge_derives/true.rs
new file mode 100644 (file)
index 0000000..18b8443
--- /dev/null
@@ -0,0 +1,46 @@
+// rustfmt-merge_derives: true
+// Merge multiple derives to a single one.
+
+#[bar]
+#[derive(Eq, PartialEq)]
+#[foo]
+#[derive(Debug)]
+#[foobar]
+#[derive(Copy, Clone)]
+pub enum Foo {}
+
+#[derive(Eq, PartialEq)]
+#[derive(Debug)]
+#[foobar]
+#[derive(Copy, Clone)]
+pub enum Bar {}
+
+#[derive(Eq, PartialEq)]
+#[derive(Debug)]
+#[derive(Copy, Clone)]
+pub enum FooBar {}
+
+mod foo {
+#[bar]
+#[derive(Eq, PartialEq)]
+#[foo]
+#[derive(Debug)]
+#[foobar]
+#[derive(Copy, Clone)]
+pub enum Foo {}
+}
+
+mod bar {
+#[derive(Eq, PartialEq)]
+#[derive(Debug)]
+#[foobar]
+#[derive(Copy, Clone)]
+pub enum Bar {}
+}
+
+mod foobar {
+#[derive(Eq, PartialEq)]
+#[derive(Debug)]
+#[derive(Copy, Clone)]
+pub enum FooBar {}
+}
diff --git a/tests/source/configs/normalize_comments/false.rs b/tests/source/configs/normalize_comments/false.rs
new file mode 100644 (file)
index 0000000..488962e
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_comments: false
+// Normalize comments
+
+// Lorem ipsum:
+fn dolor() -> usize {}
+
+/* sit amet: */
+fn adipiscing() -> usize {}
+
+// #652
+////////////////////////////////////////////////////////////////////////////////
+// Basic slice extension methods
+////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/source/configs/normalize_comments/true.rs b/tests/source/configs/normalize_comments/true.rs
new file mode 100644 (file)
index 0000000..c74a980
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_comments: true
+// Normalize comments
+
+// Lorem ipsum:
+fn dolor() -> usize {}
+
+/* sit amet: */
+fn adipiscing() -> usize {}
+
+// #652
+////////////////////////////////////////////////////////////////////////////////
+// Basic slice extension methods
+////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/source/configs/reorder_imported_names/false.rs b/tests/source/configs/reorder_imported_names/false.rs
new file mode 100644 (file)
index 0000000..91db89c
--- /dev/null
@@ -0,0 +1,4 @@
+// rustfmt-reorder_imported_names: false
+// Reorder imported names
+
+use super::{lorem, ipsum, dolor, sit};
diff --git a/tests/source/configs/reorder_imported_names/true.rs b/tests/source/configs/reorder_imported_names/true.rs
new file mode 100644 (file)
index 0000000..69da618
--- /dev/null
@@ -0,0 +1,4 @@
+// rustfmt-reorder_imported_names: true
+// Reorder imported names
+
+use super::{lorem, ipsum, dolor, sit};
diff --git a/tests/source/configs/reorder_imports/false.rs b/tests/source/configs/reorder_imports/false.rs
new file mode 100644 (file)
index 0000000..4b85684
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-reorder_imports: false
+// Reorder imports
+
+use lorem;
+use ipsum;
+use dolor;
+use sit;
diff --git a/tests/source/configs/reorder_imports/true.rs b/tests/source/configs/reorder_imports/true.rs
new file mode 100644 (file)
index 0000000..2a40f6d
--- /dev/null
@@ -0,0 +1,19 @@
+// rustfmt-reorder_imports: true
+// Reorder imports
+
+use lorem;
+use ipsum;
+use dolor;
+use sit;
+
+fn foo() {
+    use C;
+    use B;
+    use A;
+
+    bar();
+
+    use F;
+    use E;
+    use D;
+}
diff --git a/tests/source/configs/reorder_imports_in_group/false.rs b/tests/source/configs/reorder_imports_in_group/false.rs
new file mode 100644 (file)
index 0000000..87711bb
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-reorder_imports: true
+// rustfmt-reorder_imports_in_group: false
+// Reorder imports in group
+
+/// This comment should stay with `use std::mem;`
+use std::mem;
+use std::io;
+
+use lorem;
+/// This comment should stay with `use ipsum;`
+use ipsum;
+use dolor;
+use sit;
diff --git a/tests/source/configs/reorder_imports_in_group/true.rs b/tests/source/configs/reorder_imports_in_group/true.rs
new file mode 100644 (file)
index 0000000..b5690b8
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-reorder_imports: true
+// rustfmt-reorder_imports_in_group: true
+// Reorder imports in group
+
+/// This comment should stay with `use std::mem;`
+use std::mem;
+use std::io;
+
+use lorem;
+/// This comment should stay with `use ipsum;`
+use ipsum;
+use dolor;
+use sit;
diff --git a/tests/source/configs/same_line_attributes/false.rs b/tests/source/configs/same_line_attributes/false.rs
new file mode 100644 (file)
index 0000000..a7983fd
--- /dev/null
@@ -0,0 +1,26 @@
+// rustfmt-same_line_attributes: false
+// Option to place attributes on the same line as fields and variants where possible
+
+enum Lorem {
+    #[ serde(skip_serializing) ]
+    Ipsum,
+    #[ serde(skip_serializing) ]
+    Dolor,
+    #[ serde(skip_serializing) ]
+    Amet,
+}
+
+struct Lorem {
+    #[ serde(rename = "Ipsum") ]
+    ipsum: usize,
+    #[ serde(rename = "Dolor") ]
+    dolor: usize,
+    #[ serde(rename = "Amet") ]
+    amet: usize,
+}
+
+// #1943
+pub struct Bzip2 {
+    # [ serde (rename = "level") ]
+     level: i32 ,
+}
diff --git a/tests/source/configs/same_line_attributes/true.rs b/tests/source/configs/same_line_attributes/true.rs
new file mode 100644 (file)
index 0000000..bf79695
--- /dev/null
@@ -0,0 +1,20 @@
+// rustfmt-same_line_attributes: true
+// Option to place attributes on the same line as fields and variants where possible
+
+enum Lorem {
+    #[ serde(skip_serializing) ]
+    Ipsum,
+    #[ serde(skip_serializing) ]
+    Dolor,
+    #[ serde(skip_serializing) ]
+    Amet,
+}
+
+struct Lorem {
+    #[ serde(rename = "Ipsum") ]
+    ipsum: usize,
+    #[ serde(rename = "Dolor") ]
+    dolor: usize,
+    #[ serde(rename = "Amet") ]
+    amet: usize,
+}
diff --git a/tests/source/configs/space_before_colon/true.rs b/tests/source/configs/space_before_colon/true.rs
new file mode 100644 (file)
index 0000000..0a59760
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-space_before_colon: true
+// Space before colon
+
+fn lorem<T : Eq>(t : T) {
+    let ipsum: Dolor = sit;
+}
+
+const LOREM : Lorem = Lorem {
+    ipsum : dolor,
+    sit : amet,
+};
diff --git a/tests/source/configs/spaces_around_ranges/false.rs b/tests/source/configs/spaces_around_ranges/false.rs
new file mode 100644 (file)
index 0000000..3d431e4
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-spaces_around_ranges: false
+// Spaces around ranges
+
+fn main() {
+    let lorem = 0..10;
+}
diff --git a/tests/source/configs/spaces_around_ranges/true.rs b/tests/source/configs/spaces_around_ranges/true.rs
new file mode 100644 (file)
index 0000000..8e9a311
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-spaces_around_ranges: true
+// Spaces around ranges
+
+fn main() {
+    let lorem = 0..10;
+}
diff --git a/tests/source/configs/spaces_within_parens_and_brackets/false.rs b/tests/source/configs/spaces_within_parens_and_brackets/false.rs
new file mode 100644 (file)
index 0000000..908373c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-spaces_within_parens_and_brackets: false
+// Spaces within parens and brackets
+
+fn lorem<T: Eq>(t: T) {
+    let lorem = (ipsum, dolor);
+    let lorem: [usize; 2] = [ipsum, dolor];
+}
diff --git a/tests/source/configs/spaces_within_parens_and_brackets/true.rs b/tests/source/configs/spaces_within_parens_and_brackets/true.rs
new file mode 100644 (file)
index 0000000..2e3c92d
--- /dev/null
@@ -0,0 +1,133 @@
+// rustfmt-spaces_within_parens_and_brackets: true
+// Spaces within parens and brackets
+
+fn lorem<T: Eq>(t: T) {
+    let lorem = (ipsum, dolor);
+    let lorem: [usize; 2] = [ipsum, dolor];
+}
+
+enum E {
+    A(u32),
+    B(u32, u32),
+    C(u32, u32, u32),
+    D(),
+}
+
+struct TupleStruct0();
+struct TupleStruct1(u32);
+struct TupleStruct2(u32, u32);
+
+fn fooEmpty() {}
+
+fn foo(e: E, _: u32) -> (u32, u32) {
+    // Tuples
+    let t1 = ();
+    let t2 = (1,);
+    let t3 = (1, 2);
+
+    let ts0 = TupleStruct0();
+    let ts1 = TupleStruct1(1);
+    let ts2 = TupleStruct2(1, 2);
+
+    // Tuple pattern
+    let (a,b,c) = (1,2,3);
+
+    // Expressions
+    let x = (1 + 2) * (3);
+
+    // Function call
+    fooEmpty();
+    foo(1, 2);
+
+    // Pattern matching
+    match e {
+        A(_) => (),
+        B(_, _) => (),
+        C(..) => (),
+        D => (),
+    }
+
+    (1,2)
+}
+
+struct Foo<T> {
+    i: T,
+}
+
+struct Bar<T, E> {
+    i: T,
+    e: E,
+}
+
+struct Foo<'a> {
+    i: &'a str,
+}
+
+enum E<T> {
+    T(T),
+}
+
+enum E<T, S> {
+    T(T),
+    S(S),
+}
+
+fn foo<T>(a: T) {
+    foo::<u32>(10);
+}
+
+fn foo<T, E>(a: T, b: E) {
+    foo::<u32, str>(10, "bar");
+}
+
+fn foo<T: Send, E: Send>(a: T, b: E) {
+    foo::<u32, str>(10, "bar");
+
+    let opt: Option<u32>;
+    let res: Result<u32, String>;
+}
+
+fn foo<'a>(a: &'a str) {
+    foo("foo");
+}
+
+fn foo<'a, 'b>(a: &'a str, b: &'b str) {
+    foo("foo", "bar");
+}
+
+impl Foo {
+    fn bar() {
+        <Foo as Foo>::bar();
+    }
+}
+
+trait MyTrait<A, D> {}
+impl<A: Send, D: Send> MyTrait<A, D> for Foo {}
+
+fn foo() where for<'a> u32: 'a {}
+
+fn main() {
+    let arr: [i32; 5] = [1, 2, 3, 4, 5];
+    let arr: [i32; 500] = [0; 500];
+
+    let v = vec![1, 2, 3];
+    assert_eq!(arr, [1, 2, 3]);
+
+    let i = arr[0];
+
+    let slice = &arr[1..2];
+
+    let line100_________________________________________________________________________ = [1, 2];
+    let line101__________________________________________________________________________ = [1, 2];
+    let line102___________________________________________________________________________ = [1, 2];
+    let line103____________________________________________________________________________ = [1, 2];
+    let line104_____________________________________________________________________________ = [1, 2];
+
+    let line100_____________________________________________________________________ = vec![1, 2];
+    let line101______________________________________________________________________ = vec![1, 2];
+    let line102_______________________________________________________________________ = vec![1, 2];
+    let line103________________________________________________________________________ = vec![1, 2];
+    let line104_________________________________________________________________________ = vec![1, 2];
+}
+
+fn f(slice: &[i32]) {}
diff --git a/tests/source/configs/struct_field_align_threshold/20.rs b/tests/source/configs/struct_field_align_threshold/20.rs
new file mode 100644 (file)
index 0000000..e68340b
--- /dev/null
@@ -0,0 +1,383 @@
+// rustfmt-struct_field_align_threshold: 20
+// rustfmt-normalize_comments: true
+// rustfmt-wrap_comments: true
+// rustfmt-error_on_line_overflow: false
+
+struct Foo {
+    x: u32,
+    yy: u32, // comment
+    zzz: u32,
+}
+
+pub struct Bar {
+    x: u32,
+    yy: u32,
+    zzz: u32,
+
+    xxxxxxx: u32,
+}
+
+fn main() {
+    let foo = Foo {
+        x: 0,
+        yy: 1,
+        zzz: 2,
+    };
+
+    let bar = Bar {
+        x: 0,
+        yy: 1,
+        zzz: 2,
+
+        xxxxxxx: 3,
+    };
+}
+
+                                                                       /// A Doc comment
+#[AnAttribute]
+pub struct Foo {
+    #[rustfmt_skip]
+    f :   SomeType, // Comment beside a field
+    f: SomeType, // Comment beside a field
+    // Comment on a field
+    #[AnAttribute]
+    g: SomeOtherType,
+      /// A doc comment on a field
+    h: AThirdType,
+    pub i: TypeForPublicField
+}
+
+// #1029
+pub struct Foo {
+    #[doc(hidden)]
+    // This will NOT get deleted!
+    bar: String, // hi
+}
+
+// #1029
+struct X {
+    // `x` is an important number.
+    #[allow(unused)] // TODO: use
+    x: u32,
+}
+
+// #410
+#[allow(missing_docs)]
+pub struct Writebatch<K: Key> {
+    #[allow(dead_code)] //only used for holding the internal pointer
+    writebatch: RawWritebatch,
+    marker: PhantomData<K>,
+}
+
+struct Bar;
+
+struct NewType(Type,       OtherType);
+
+struct
+NewInt     <T: Copy>(pub i32, SomeType /* inline comment */, T /* sup */
+
+
+    );
+
+struct Qux<'a,
+           N: Clone + 'a,
+           E: Clone + 'a,
+           G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
+           W: Write + Copy>
+(
+    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
+    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
+    #[AnAttr]
+    // Comment
+    /// Testdoc
+    G,
+    pub W,
+);
+
+struct Tuple(/*Comment 1*/ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
+             /* Comment 2   */ BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,);
+
+// With a where clause and generics.
+pub struct Foo<'a, Y: Baz>
+    where X: Whatever
+{
+    f: SomeType, // Comment beside a field
+}
+
+struct Baz {
+
+    a: A,  // Comment A
+    b: B, // Comment B
+    c: C,   // Comment C
+
+}
+
+struct Baz {
+    a: A,  // Comment A
+
+    b: B, // Comment B
+
+
+
+
+    c: C,   // Comment C
+}
+
+struct Baz {
+
+    a: A,
+
+    b: B,
+    c: C,
+
+
+
+    
+    d: D
+
+}
+
+struct Baz
+{
+    // Comment A
+    a: A,
+    
+    // Comment B
+b: B,
+    // Comment C
+      c: C,}
+
+// Will this be a one-liner?
+struct Tuple(
+    A, //Comment
+    B
+);
+
+pub struct State<F: FnMut() -> time::Timespec> { now: F }
+
+pub struct State<F: FnMut() -> ()> { now: F }
+
+pub struct State<F: FnMut()> { now: F }
+
+struct Palette { /// A map of indices in the palette to a count of pixels in approximately that color
+                    foo: i32}
+
+// Splitting a single line comment into a block previously had a misalignment
+// when the field had attributes
+struct FieldsWithAttributes {
+    // Pre Comment
+    #[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
+    //Another pre comment
+    #[attr1]
+    #[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
+}
+
+struct Deep {
+    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep: node::Handle<IdRef<'id, Node<K, V>>,
+                                                     Type,
+                                                     NodeType>,
+}
+
+struct Foo<T>(T);
+struct Foo<T>(T) where T: Copy, T: Eq;
+struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU);
+struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT) where T: PartialEq;
+struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT) where T: PartialEq;
+struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU) where T: PartialEq;
+struct Foo<T>(TTTTTTTTTTTTTTTTT, // Foo
+              UUUUUUUUUUUUUUUUUUUUUUUU /* Bar */,
+              // Baz
+              TTTTTTTTTTTTTTTTTTT,
+              // Qux (FIXME #572 - doc comment)
+              UUUUUUUUUUUUUUUUUUU);
+
+mod m {
+    struct X<T> where T: Sized {
+        a: T,
+    }
+}
+
+struct Foo<T>(TTTTTTTTTTTTTTTTTTT,
+              /// Qux
+    UUUUUUUUUUUUUUUUUUU);
+
+struct Issue677 {
+    pub ptr: *const libc::c_void,
+    pub trace: fn(  obj: 
+          *const libc::c_void, tracer   : *mut   JSTracer   ),
+}
+
+struct Foo {}
+struct Foo {
+    }
+struct Foo {
+    // comment
+    }
+struct Foo {
+    // trailing space ->    
+
+
+    }
+struct Foo { /* comment */ }
+struct Foo( /* comment */ );
+
+struct LongStruct {
+    a: A,
+    the_quick_brown_fox_jumps_over_the_lazy_dog:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
+}
+
+struct Deep {
+    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep: node::Handle<IdRef<'id, Node<Key, Value>>,
+                                                                         Type,
+                                                                         NodeType>,
+}
+
+struct Foo<C=()>(String);
+
+// #1364
+fn foo() {
+    convex_shape.set_point(0, &Vector2f { x: 400.0, y: 100.0 });
+    convex_shape.set_point(1, &Vector2f { x: 500.0, y: 70.0 });
+    convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
+    convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
+}
+
+fn main() {
+    let x = Bar;
+
+    // Comment
+    let y = Foo {a: x };
+
+    Foo { a: foo() /* comment*/, /* comment*/ b: bar(), ..something };
+
+    Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b(), };
+
+    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b(), };
+
+    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
+        // Comment
+        a: foo(), // Comment
+        // Comment
+        b: bar(), // Comment
+    };
+
+    Foo { a:Bar,
+          b:f() };
+
+    Quux { x: if cond { bar(); }, y: baz() };
+
+    A { 
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.
+    first: item(),
+        // Praesent et diam eget libero egestas mattis sit amet vitae augue.
+        // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
+        second: Item
+    };
+
+    Some(Data::MethodCallData(MethodCallData {
+        span: sub_span.unwrap(),
+        scope: self.enclosing_scope(id),
+        ref_id: def_id,
+        decl_id: Some(decl_id),
+    }));
+
+    Diagram { /*                 o        This graph demonstrates how                  
+               *                / \       significant whitespace is           
+               *               o   o      preserved.  
+               *              /|\   \
+               *             o o o   o */
+              graph: G, }
+}
+
+fn matcher() {
+    TagTerminatedByteMatcher {
+        matcher: ByteMatcher {
+        pattern: b"<HTML",
+        mask: b"\xFF\xDF\xDF\xDF\xDF\xFF",
+    },
+    };
+}
+
+fn issue177() {
+    struct Foo<T> { memb: T }
+    let foo = Foo::<i64> { memb: 10 };
+}
+
+fn issue201() {
+    let s = S{a:0, ..  b};
+}
+
+fn issue201_2() {
+    let s = S{a: S2{    .. c}, ..  b};
+}
+
+fn issue278() {
+    let s = S {
+        a: 0,
+        //       
+        b: 0,
+    };
+    let s1 = S {
+        a: 0,
+        // foo
+        //      
+        // bar
+        b: 0,
+    };
+}
+
+fn struct_exprs() {
+    Foo
+    { a :  1, b:f( 2)};
+    Foo{a:1,b:f(2),..g(3)};
+    LoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongStruct { ..base };
+    IntrinsicISizesContribution { content_intrinsic_sizes: IntrinsicISizes { minimum_inline_size: 0, }, };
+}
+
+fn issue123() {
+    Foo { a: b, c: d, e: f };
+
+    Foo { a: bb, c: dd, e: ff };
+
+    Foo { a: ddddddddddddddddddddd, b: cccccccccccccccccccccccccccccccccccccc };
+}
+
+fn issue491() {
+    Foo {
+        guard: None,
+        arm: 0, // Comment
+    };
+
+    Foo {
+        arm: 0, // Comment
+    };
+
+    Foo { a: aaaaaaaaaa, b: bbbbbbbb, c: cccccccccc, d: dddddddddd, /* a comment */
+      e: eeeeeeeee };
+}
+
+fn issue698() {
+    Record {
+        ffffffffffffffffffffffffffields: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+    };
+    Record {
+        ffffffffffffffffffffffffffields: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+    }
+}
+
+fn issue835() {
+    MyStruct {};
+    MyStruct { /* a comment */ };
+    MyStruct {
+        // Another comment
+    };
+    MyStruct {}
+}
+
+fn field_init_shorthand() {
+    MyStruct { x, y, z };
+    MyStruct { x, y, z, .. base };
+    Foo { aaaaaaaaaa, bbbbbbbb, cccccccccc, dddddddddd, /* a comment */
+        eeeeeeeee };
+    Record { ffffffffffffffffffffffffffieldsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa };
+}
diff --git a/tests/source/configs/struct_lit_indent/block.rs b/tests/source/configs/struct_lit_indent/block.rs
new file mode 100644 (file)
index 0000000..47a6994
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Block
+// Struct literal-style
+
+fn main() {
+    let lorem = Lorem { ipsum: dolor, sit: amet };
+}
diff --git a/tests/source/configs/struct_lit_indent/visual.rs b/tests/source/configs/struct_lit_indent/visual.rs
new file mode 100644 (file)
index 0000000..45538e7
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Struct literal-style
+
+fn main() {
+    let lorem = Lorem { ipsum: dolor, sit: amet };
+}
diff --git a/tests/source/configs/struct_lit_single_line/false.rs b/tests/source/configs/struct_lit_single_line/false.rs
new file mode 100644 (file)
index 0000000..17cad8d
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-struct_lit_single_line: false
+// Struct literal multiline-style
+
+fn main() {
+    let lorem = Lorem { ipsum: dolor, sit: amet };
+}
diff --git a/tests/source/configs/tab_spaces/2.rs b/tests/source/configs/tab_spaces/2.rs
new file mode 100644 (file)
index 0000000..5c2667b
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-tab_spaces: 2
+// rustfmt-max_width: 30
+// rustfmt-indent_style: Block
+// Tab spaces
+
+fn lorem() {
+let ipsum = dolor();
+let sit = vec![
+"amet", "consectetur", "adipiscing", "elit."
+];
+}
diff --git a/tests/source/configs/tab_spaces/4.rs b/tests/source/configs/tab_spaces/4.rs
new file mode 100644 (file)
index 0000000..da61bbd
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-tab_spaces: 4
+// rustfmt-max_width: 30
+// rustfmt-indent_style: Block
+// Tab spaces
+
+fn lorem() {
+let ipsum = dolor();
+let sit = vec![
+"amet", "consectetur", "adipiscing", "elit."
+];
+}
diff --git a/tests/source/configs/trailing_comma/always.rs b/tests/source/configs/trailing_comma/always.rs
new file mode 100644 (file)
index 0000000..57e874c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-trailing_comma: Always
+// Trailing comma
+
+fn main() {
+    let Lorem { ipsum, dolor, sit, } = amet;
+    let Lorem { ipsum, dolor, sit, amet, consectetur, adipiscing } = elit;
+}
diff --git a/tests/source/configs/trailing_comma/never.rs b/tests/source/configs/trailing_comma/never.rs
new file mode 100644 (file)
index 0000000..4da3b99
--- /dev/null
@@ -0,0 +1,23 @@
+// rustfmt-trailing_comma: Never
+// Trailing comma
+
+fn main() {
+    let Lorem { ipsum, dolor, sit, } = amet;
+    let Lorem { ipsum, dolor, sit, amet, consectetur, adipiscing } = elit;
+
+    // #1544
+    if let VrMsg::ClientReply {request_num: reply_req_num, value, ..} = msg {
+        let _ = safe_assert_eq!(reply_req_num, request_num, op);
+        return Ok((request_num, op, value));
+    }
+
+    // #1710
+    pub struct FileInput {
+        input: StringInput,
+        file_name: OsString,
+    }
+    match len {
+        Some(len) => Ok(new(self.input, self.pos + len)),
+        None => Err(self),
+    }
+}
diff --git a/tests/source/configs/trailing_comma/vertical.rs b/tests/source/configs/trailing_comma/vertical.rs
new file mode 100644 (file)
index 0000000..c903e82
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-trailing_comma: Vertical
+// Trailing comma
+
+fn main() {
+    let Lorem { ipsum, dolor, sit, } = amet;
+    let Lorem { ipsum, dolor, sit, amet, consectetur, adipiscing } = elit;
+}
diff --git a/tests/source/configs/type_punctuation_density/compressed.rs b/tests/source/configs/type_punctuation_density/compressed.rs
new file mode 100644 (file)
index 0000000..6e16e61
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-type_punctuation_density: Compressed
+// Type punctuation density
+
+fn lorem<Ipsum:Dolor+Sit=Amet>() {
+    // body
+}
diff --git a/tests/source/configs/type_punctuation_density/wide.rs b/tests/source/configs/type_punctuation_density/wide.rs
new file mode 100644 (file)
index 0000000..1fcdddf
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-type_punctuation_density: Wide
+// Type punctuation density
+
+fn lorem<Ipsum:Dolor+Sit=Amet>() {
+    // body
+}
diff --git a/tests/source/configs/use_try_shorthand/false.rs b/tests/source/configs/use_try_shorthand/false.rs
new file mode 100644 (file)
index 0000000..de7f8b4
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-use_try_shorthand: false
+// Use try! shorthand
+
+fn main() {
+    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
+}
diff --git a/tests/source/configs/use_try_shorthand/true.rs b/tests/source/configs/use_try_shorthand/true.rs
new file mode 100644 (file)
index 0000000..9015ec4
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-use_try_shorthand: true
+// Use try! shorthand
+
+fn main() {
+    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
+}
diff --git a/tests/source/configs/where_pred_indent/block.rs b/tests/source/configs/where_pred_indent/block.rs
new file mode 100644 (file)
index 0000000..450491f
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Block
+// Where predicate indent
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
+    // body
+}
diff --git a/tests/source/configs/where_pred_indent/visual.rs b/tests/source/configs/where_pred_indent/visual.rs
new file mode 100644 (file)
index 0000000..055806b
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Where predicate indent
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
+    // body
+}
diff --git a/tests/source/configs/where_single_line/true.rs b/tests/source/configs/where_single_line/true.rs
new file mode 100644 (file)
index 0000000..daaab86
--- /dev/null
@@ -0,0 +1,24 @@
+// rustfmt-where_single_line: true
+// Where style
+
+
+fn lorem_two_items<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Lorem: Eq {
+    // body
+}
+
+fn lorem_multi_line<Ipsum, Dolor, Sit, Amet>(
+    a: Aaaaaaaaaaaaaaa,
+    b: Bbbbbbbbbbbbbbbb,
+    c: Ccccccccccccccccc,
+    d: Ddddddddddddddddddddddddd,
+    e: Eeeeeeeeeeeeeeeeeee,
+) -> T
+where
+    Ipsum: Eq,
+{
+    // body
+}
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq {
+    // body
+}
diff --git a/tests/source/configs/where_style/default.rs b/tests/source/configs/where_style/default.rs
new file mode 100644 (file)
index 0000000..f08f5c6
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Visual
+// Where style
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
+    // body
+}
diff --git a/tests/source/configs/where_style/rfc.rs b/tests/source/configs/where_style/rfc.rs
new file mode 100644 (file)
index 0000000..012840b
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-indent_style: Block
+// Where style
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq {
+    // body
+}
diff --git a/tests/source/configs/wrap_comments/false.rs b/tests/source/configs/wrap_comments/false.rs
new file mode 100644 (file)
index 0000000..48ecd88
--- /dev/null
@@ -0,0 +1,8 @@
+// rustfmt-wrap_comments: false
+// rustfmt-max_width: 50
+// rustfmt-error_on_line_overflow: false
+// Wrap comments
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+}
diff --git a/tests/source/configs/wrap_comments/true.rs b/tests/source/configs/wrap_comments/true.rs
new file mode 100644 (file)
index 0000000..39a79a4
--- /dev/null
@@ -0,0 +1,15 @@
+// rustfmt-wrap_comments: true
+// rustfmt-max_width: 50
+// Wrap comments
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+}
+
+fn code_block() {
+    // ```rust
+    // let x = 3;
+    //
+    // println!("x = {}", x);
+    // ```
+}
diff --git a/tests/target/configs-array_indent-block.rs b/tests/target/configs-array_indent-block.rs
deleted file mode 100644 (file)
index 5d45824..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-indent_style: Block
-// Array layout
-
-fn main() {
-    let lorem = vec![
-        "ipsum",
-        "dolor",
-        "sit",
-        "amet",
-        "consectetur",
-        "adipiscing",
-        "elit",
-    ];
-}
diff --git a/tests/target/configs-array_indent-visual.rs b/tests/target/configs-array_indent-visual.rs
deleted file mode 100644 (file)
index 1da6ff2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// rustfmt-indent_style: Visual
-// Array layout
-
-fn main() {
-    let lorem = vec!["ipsum",
-                     "dolor",
-                     "sit",
-                     "amet",
-                     "consectetur",
-                     "adipiscing",
-                     "elit"];
-}
diff --git a/tests/target/configs-blank_lines_lower_bound-1.rs b/tests/target/configs-blank_lines_lower_bound-1.rs
deleted file mode 100644 (file)
index 9706699..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-blank_lines_lower_bound: 1
-
-fn foo() {}
-
-fn bar() {}
-
-// comment
-fn foobar() {}
-
-fn foo1() {}
-
-fn bar1() {}
-
-// comment
-
-fn foobar1() {}
diff --git a/tests/target/configs-chain_indent-block.rs b/tests/target/configs-chain_indent-block.rs
deleted file mode 100644 (file)
index 23340a4..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// rustfmt-indent_style: Block
-// Chain indent
-
-fn main() {
-    let lorem = ipsum
-        .dolor()
-        .sit()
-        .amet()
-        .consectetur()
-        .adipiscing()
-        .elite();
-}
diff --git a/tests/target/configs-chain_indent-visual.rs b/tests/target/configs-chain_indent-visual.rs
deleted file mode 100644 (file)
index 569f3d8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-indent_style: Visual
-// Chain indent
-
-fn main() {
-    let lorem = ipsum.dolor()
-                     .sit()
-                     .amet()
-                     .consectetur()
-                     .adipiscing()
-                     .elite();
-}
diff --git a/tests/target/configs-combine_control_expr-false.rs b/tests/target/configs-combine_control_expr-false.rs
deleted file mode 100644 (file)
index 81eff08..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-// rustfmt-indent_style: Block
-// rustfmt-combine_control_expr: false
-// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.
-
-fn main() {
-    // Call
-    foo(bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Mac
-    foo(foo!(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // MethodCall
-    foo(x.foo::<Bar, Baz>(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Block
-    foo!({
-        foo();
-        bar();
-    });
-
-    // Closure
-    foo(|x| {
-        let y = x + 1;
-        y
-    });
-
-    // Match
-    foo(match opt {
-        Some(x) => x,
-        None => y,
-    });
-
-    // Struct
-    foo(Bar {
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    });
-
-    // If
-    foo!(
-        if x {
-            foo();
-        } else {
-            bar();
-        }
-    );
-
-    // IfLet
-    foo!(
-        if let Some(..) = x {
-            foo();
-        } else {
-            bar();
-        }
-    );
-
-    // While
-    foo!(
-        while x {
-            foo();
-            bar();
-        }
-    );
-
-    // WhileLet
-    foo!(
-        while let Some(..) = x {
-            foo();
-            bar();
-        }
-    );
-
-    // ForLoop
-    foo!(
-        for x in y {
-            foo();
-            bar();
-        }
-    );
-
-    // Loop
-    foo!(
-        loop {
-            foo();
-            bar();
-        }
-    );
-
-    // Tuple
-    foo((
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // AddrOf
-    foo(&bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Box
-    foo(box Bar {
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    });
-
-    // Unary
-    foo(!bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Try
-    foo(bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    )?);
-
-    // Cast
-    foo(Bar {
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
-    } as i64);
-}
diff --git a/tests/target/configs-combine_control_expr-true.rs b/tests/target/configs-combine_control_expr-true.rs
deleted file mode 100644 (file)
index c5372c2..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-// rustfmt-indent_style: Block
-// rustfmt-combine_control_expr: true
-// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.
-
-fn main() {
-    // Call
-    foo(bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Mac
-    foo(foo!(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // MethodCall
-    foo(x.foo::<Bar, Baz>(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Block
-    foo!({
-        foo();
-        bar();
-    });
-
-    // Closure
-    foo(|x| {
-        let y = x + 1;
-        y
-    });
-
-    // Match
-    foo(match opt {
-        Some(x) => x,
-        None => y,
-    });
-
-    // Struct
-    foo(Bar {
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    });
-
-    // If
-    foo!(if x {
-        foo();
-    } else {
-        bar();
-    });
-
-    // IfLet
-    foo!(if let Some(..) = x {
-        foo();
-    } else {
-        bar();
-    });
-
-    // While
-    foo!(while x {
-        foo();
-        bar();
-    });
-
-    // WhileLet
-    foo!(while let Some(..) = x {
-        foo();
-        bar();
-    });
-
-    // ForLoop
-    foo!(for x in y {
-        foo();
-        bar();
-    });
-
-    // Loop
-    foo!(loop {
-        foo();
-        bar();
-    });
-
-    // Tuple
-    foo((
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // AddrOf
-    foo(&bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Box
-    foo(box Bar {
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    });
-
-    // Unary
-    foo(!bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    ));
-
-    // Try
-    foo(bar(
-        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
-    )?);
-
-    // Cast
-    foo(Bar {
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
-    } as i64);
-}
diff --git a/tests/target/configs-comment_width-above.rs b/tests/target/configs-comment_width-above.rs
deleted file mode 100644 (file)
index ddfecda..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// rustfmt-comment_width: 40
-// rustfmt-wrap_comments: true
-// Comment width
-
-fn main() {
-    // Lorem ipsum dolor sit amet,
-    // consectetur adipiscing elit.
-}
diff --git a/tests/target/configs-comment_width-below.rs b/tests/target/configs-comment_width-below.rs
deleted file mode 100644 (file)
index abbc593..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-comment_width: 80
-// rustfmt-wrap_comments: true
-// Comment width
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-}
diff --git a/tests/target/configs-comment_width-ignore.rs b/tests/target/configs-comment_width-ignore.rs
deleted file mode 100644 (file)
index c86e71c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-comment_width: 40
-// rustfmt-wrap_comments: false
-// Comment width
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-}
diff --git a/tests/target/configs-condense_wildcard_suffices-false.rs b/tests/target/configs-condense_wildcard_suffices-false.rs
deleted file mode 100644 (file)
index 3b967f3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-condense_wildcard_suffixes: false
-// Condense wildcard suffixes
-
-fn main() {
-    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
-}
diff --git a/tests/target/configs-condense_wildcard_suffices-true.rs b/tests/target/configs-condense_wildcard_suffices-true.rs
deleted file mode 100644 (file)
index 4f880ab..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-condense_wildcard_suffixes: true
-// Condense wildcard suffixes
-
-fn main() {
-    let (lorem, ipsum, ..) = (1, 2, 3, 4);
-}
diff --git a/tests/target/configs-control_brace_style-always_next_line.rs b/tests/target/configs-control_brace_style-always_next_line.rs
deleted file mode 100644 (file)
index 7dc06f2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// rustfmt-control_brace_style: AlwaysNextLine
-// Control brace style
-
-fn main() {
-    if lorem
-    {
-        println!("ipsum!");
-    }
-    else
-    {
-        println!("dolor!");
-    }
-    match magi
-    {
-        Homura => "Akemi",
-        Madoka => "Kaname",
-    }
-}
diff --git a/tests/target/configs-control_brace_style-always_same_line.rs b/tests/target/configs-control_brace_style-always_same_line.rs
deleted file mode 100644 (file)
index 993b6b6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-control_brace_style: AlwaysSameLine
-// Control brace style
-
-fn main() {
-    if lorem {
-        println!("ipsum!");
-    } else {
-        println!("dolor!");
-    }
-    match magi {
-        Homura => "Akemi",
-        Madoka => "Kaname",
-    }
-}
diff --git a/tests/target/configs-control_brace_style-closing_next_line.rs b/tests/target/configs-control_brace_style-closing_next_line.rs
deleted file mode 100644 (file)
index 013852e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// rustfmt-control_brace_style: ClosingNextLine
-// Control brace style
-
-fn main() {
-    if lorem {
-        println!("ipsum!");
-    }
-    else {
-        println!("dolor!");
-    }
-    match magi {
-        Homura => "Akemi",
-        Madoka => "Kaname",
-    }
-}
diff --git a/tests/target/configs-control_style-rfc.rs b/tests/target/configs-control_style-rfc.rs
deleted file mode 100644 (file)
index 6619d8b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// rustfmt-indent_style: Block
-
-// #1618
-fn main() {
-    loop {
-        if foo {
-            if ((right_paddle_speed < 0.) && (right_paddle.position().y - paddle_size.y / 2. > 5.))
-                || ((right_paddle_speed > 0.)
-                    && (right_paddle.position().y + paddle_size.y / 2. < game_height as f32 - 5.))
-            {
-                foo
-            }
-            if ai_timer.elapsed_time().as_microseconds() > ai_time.as_microseconds() {
-                if ball.position().y + ball_radius > right_paddle.position().y + paddle_size.y / 2.
-                {
-                    foo
-                }
-            }
-        }
-    }
-}
-
-fn issue1656() {
-    {
-        {
-            match rewrite {
-                Some(ref body_str)
-                    if (!body_str.contains('\n') && body_str.len() <= arm_shape.width)
-                        || !context.config.match_arm_blocks()
-                        || (extend && first_line_width(body_str) <= arm_shape.width)
-                        || is_block =>
-                {
-                    return None;
-                }
-                _ => {}
-            }
-        }
-    }
-}
diff --git a/tests/target/configs-disable_all_formatting-false.rs b/tests/target/configs-disable_all_formatting-false.rs
deleted file mode 100644 (file)
index 1a0477d..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// rustfmt-disable_all_formatting: false
-// Disable all formatting
-
-fn main() {
-    if lorem {
-        println!("ipsum!");
-    } else {
-        println!("dolor!");
-    }
-}
diff --git a/tests/target/configs-disable_all_formatting-true.rs b/tests/target/configs-disable_all_formatting-true.rs
deleted file mode 100644 (file)
index 736ccf5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-disable_all_formatting: true
-// Disable all formatting
-
-fn main() {
-    if lorem{println!("ipsum!");}else{println!("dolor!");}
-}
diff --git a/tests/target/configs-empty_item_single_line-false.rs b/tests/target/configs-empty_item_single_line-false.rs
deleted file mode 100644 (file)
index b7886df..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// rustfmt-empty_item_single_line: false
-// Empty impl on single line
-
-impl Lorem {
-}
-
-impl Ipsum {
-}
-
-fn lorem() {
-}
-
-fn lorem() {
-
-}
diff --git a/tests/target/configs-empty_item_single_line-true.rs b/tests/target/configs-empty_item_single_line-true.rs
deleted file mode 100644 (file)
index 0755485..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// rustfmt-empty_item_single_line: true
-// Empty impl on single line
-
-impl Lorem {}
-
-impl Ipsum {}
-
-fn lorem() {}
-
-fn lorem() {}
diff --git a/tests/target/configs-error_on_line_overflow-false.rs b/tests/target/configs-error_on_line_overflow-false.rs
deleted file mode 100644 (file)
index fa70ae7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-error_on_line_overflow: false
-// Error on line overflow
-
-fn main() {
-    let lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit_lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit;
-}
diff --git a/tests/target/configs-error_on_unformatted-false.rs b/tests/target/configs-error_on_unformatted-false.rs
deleted file mode 100644 (file)
index 6a78374..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// rustfmt-error_on_unformatted: false
-// Error on line overflow comment or string literals.
-
-// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-fn main() {
-    // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-
-    let x = "                                                                                                  ";
-    let a = "
-  
-";
-}
diff --git a/tests/target/configs-fn_args_density-compressed.rs b/tests/target/configs-fn_args_density-compressed.rs
deleted file mode 100644 (file)
index 9928372..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// rustfmt-fn_args_density: Compressed
-// Function arguments density
-
-trait Lorem {
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
-        // body
-    }
-
-    fn lorem(
-        ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
-        adipiscing: Adipiscing, elit: Elit,
-    );
-
-    fn lorem(
-        ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
-        adipiscing: Adipiscing, elit: Elit,
-    ) {
-        // body
-    }
-}
diff --git a/tests/target/configs-fn_args_density-tall.rs b/tests/target/configs-fn_args_density-tall.rs
deleted file mode 100644 (file)
index 6ee43b4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// rustfmt-fn_args_density: Tall
-// Function arguments density
-
-trait Lorem {
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
-
-    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
-        // body
-    }
-
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-        consectetur: onsectetur,
-        adipiscing: Adipiscing,
-        elit: Elit,
-    );
-
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-        consectetur: onsectetur,
-        adipiscing: Adipiscing,
-        elit: Elit,
-    ) {
-        // body
-    }
-}
diff --git a/tests/target/configs-fn_args_density-vertical.rs b/tests/target/configs-fn_args_density-vertical.rs
deleted file mode 100644 (file)
index d48b349..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// rustfmt-fn_args_density: Vertical
-// Function arguments density
-
-trait Lorem {
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-    );
-
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-    ) {
-        // body
-    }
-
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-        consectetur: onsectetur,
-        adipiscing: Adipiscing,
-        elit: Elit,
-    );
-
-    fn lorem(
-        ipsum: Ipsum,
-        dolor: Dolor,
-        sit: Sit,
-        amet: Amet,
-        consectetur: onsectetur,
-        adipiscing: Adipiscing,
-        elit: Elit,
-    ) {
-        // body
-    }
-}
diff --git a/tests/target/configs-fn_args_indent-block.rs b/tests/target/configs-fn_args_indent-block.rs
deleted file mode 100644 (file)
index 80f4e13..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// rustfmt-indent_style: Block
-// Function arguments layout
-
-fn lorem() {}
-
-fn lorem(ipsum: usize) {}
-
-fn lorem(
-    ipsum: usize,
-    dolor: usize,
-    sit: usize,
-    amet: usize,
-    consectetur: usize,
-    adipiscing: usize,
-    elit: usize,
-) {
-    // body
-}
-
-// #1441
-extern "system" {
-    pub fn GetConsoleHistoryInfo(
-        console_history_info: *mut ConsoleHistoryInfo,
-    ) -> Boooooooooooooool;
-}
-
-// rustfmt should not add trailing comma for variadic function. See #1623.
-extern "C" {
-    pub fn variadic_fn(
-        first_parameter: FirstParameterType,
-        second_parameter: SecondParameterType,
-        ...
-    );
-}
-
-// #1652
-fn deconstruct(
-    foo: Bar,
-) -> (
-    SocketAddr,
-    Header,
-    Method,
-    RequestUri,
-    HttpVersion,
-    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
-) {
-}
diff --git a/tests/target/configs-fn_args_indent-visual.rs b/tests/target/configs-fn_args_indent-visual.rs
deleted file mode 100644 (file)
index 04c2eae..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// rustfmt-indent_style: Visual
-// Function arguments layout
-
-fn lorem() {}
-
-fn lorem(ipsum: usize) {}
-
-fn lorem(ipsum: usize,
-         dolor: usize,
-         sit: usize,
-         amet: usize,
-         consectetur: usize,
-         adipiscing: usize,
-         elit: usize) {
-    // body
-}
-
-// #1922
-extern "C" {
-    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
-                                    uplo: c_char,
-                                    n: lapack_int,
-                                    nrhs: lapack_int,
-                                    a: *const lapack_complex_float,
-                                    lda: lapack_int,
-                                    ipiv: *const lapack_int,
-                                    b: *mut lapack_complex_float,
-                                    ldb: lapack_int)
-                                    -> lapack_int;
-
-    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
-                                    uplo: c_char,
-                                    n: lapack_int,
-                                    nrhs: lapack_int,
-                                    lda: lapack_int,
-                                    ipiv: *const lapack_int,
-                                    b: *mut lapack_complex_float,
-                                    ldb: lapack_int)
-                                    -> lapack_int;
-}
diff --git a/tests/target/configs-fn_brace_style-always_next_line.rs b/tests/target/configs-fn_brace_style-always_next_line.rs
deleted file mode 100644 (file)
index 2755a26..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// rustfmt-brace_style: AlwaysNextLine
-// Function brace style
-
-fn lorem()
-{
-    // body
-}
-
-fn lorem(ipsum: usize)
-{
-    // body
-}
-
-fn lorem<T>(ipsum: T)
-where
-    T: Add + Sub + Mul + Div,
-{
-    // body
-}
diff --git a/tests/target/configs-fn_brace_style-prefer_same_line.rs b/tests/target/configs-fn_brace_style-prefer_same_line.rs
deleted file mode 100644 (file)
index 23f98b6..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// rustfmt-brace_style: PreferSameLine
-// Function brace style
-
-fn lorem() {
-    // body
-}
-
-fn lorem(ipsum: usize) {
-    // body
-}
-
-fn lorem<T>(ipsum: T)
-where
-    T: Add + Sub + Mul + Div, {
-    // body
-}
diff --git a/tests/target/configs-fn_brace_style-same_line_where.rs b/tests/target/configs-fn_brace_style-same_line_where.rs
deleted file mode 100644 (file)
index 2afe599..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// rustfmt-brace_style: SameLineWhere
-// Function brace style
-
-fn lorem() {
-    // body
-}
-
-fn lorem(ipsum: usize) {
-    // body
-}
-
-fn lorem<T>(ipsum: T)
-where
-    T: Add + Sub + Mul + Div,
-{
-    // body
-}
diff --git a/tests/target/configs-fn_call_indent-block.rs b/tests/target/configs-fn_call_indent-block.rs
deleted file mode 100644 (file)
index d352221..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-// rustfmt-indent_style: Block
-// Function call style
-
-fn main() {
-    lorem(
-        "lorem",
-        "ipsum",
-        "dolor",
-        "sit",
-        "amet",
-        "consectetur",
-        "adipiscing",
-        "elit",
-    );
-    // #1501
-    let hyper = Arc::new(Client::with_connector(HttpsConnector::new(
-        TlsClient::new(),
-    )));
-
-    // chain
-    let x = yooooooooooooo
-        .fooooooooooooooo
-        .baaaaaaaaaaaaar(hello, world);
-
-    // #1380
-    {
-        {
-            let creds = self.client
-                .client_credentials(&self.config.auth.oauth2.id, &self.config.auth.oauth2.secret)?;
-        }
-    }
-
-    // nesting macro and function call
-    try!(foo(
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-    ));
-    try!(foo(try!(
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
-        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-    )));
-}
-
-// #1521
-impl Foo {
-    fn map_pixel_to_coords(&self, point: &Vector2i, view: &View) -> Vector2f {
-        unsafe {
-            Vector2f::from_raw(ffi::sfRenderTexture_mapPixelToCoords(
-                self.render_texture,
-                point.raw(),
-                view.raw(),
-            ))
-        }
-    }
-}
-
-fn issue1420() {
-    given(
-        r#"
-        # Getting started
-        ...
-    "#,
-    ).running(waltz)
-}
-
-// #1563
-fn query(conn: &Connection) -> Result<()> {
-    conn.query_row(
-        r#"
-            SELECT title, date
-            FROM posts,
-            WHERE DATE(date) = $1
-        "#,
-        &[],
-        |row| Post {
-            title: row.get(0),
-            date: row.get(1),
-        },
-    )?;
-
-    Ok(())
-}
-
-// #1449
-fn future_rayon_wait_1_thread() {
-    // run with only 1 worker thread; this would deadlock if we couldn't make progress
-    let mut result = None;
-    ThreadPool::new(Configuration::new().num_threads(1))
-        .unwrap()
-        .install(|| {
-            scope(|s| {
-                use std::sync::mpsc::channel;
-                let (tx, rx) = channel();
-                let a = s.spawn_future(lazy(move || Ok::<usize, ()>(rx.recv().unwrap())));
-                //                          ^^^^ FIXME: why is this needed?
-                let b = s.spawn_future(a.map(|v| v + 1));
-                let c = s.spawn_future(b.map(|v| v + 1));
-                s.spawn(move |_| tx.send(20).unwrap());
-                result = Some(c.rayon_wait().unwrap());
-            });
-        });
-    assert_eq!(result, Some(22));
-}
-
-// #1494
-impl Cursor {
-    fn foo() {
-        self.cur_type()
-            .num_template_args()
-            .or_else(|| {
-                let n: c_int = unsafe { clang_Cursor_getNumTemplateArguments(self.x) };
-
-                if n >= 0 {
-                    Some(n as u32)
-                } else {
-                    debug_assert_eq!(n, -1);
-                    None
-                }
-            })
-            .or_else(|| {
-                let canonical = self.canonical();
-                if canonical != *self {
-                    canonical.num_template_args()
-                } else {
-                    None
-                }
-            });
-    }
-}
-
-fn issue1581() {
-    bootstrap.checks.register("PERSISTED_LOCATIONS", move || {
-        if locations2.0.inner_mut.lock().poisoned {
-            Check::new(
-                State::Error,
-                "Persisted location storage is poisoned due to a write failure",
-            )
-        } else {
-            Check::new(State::Healthy, "Persisted location storage is healthy")
-        }
-    });
-}
-
-fn issue1651() {
-    {
-        let type_list: Vec<_> =
-            try_opt!(types.iter().map(|ty| ty.rewrite(context, shape)).collect());
-    }
-}
diff --git a/tests/target/configs-fn_call_indent-block_tab_spaces_2.rs b/tests/target/configs-fn_call_indent-block_tab_spaces_2.rs
deleted file mode 100644 (file)
index 5531e61..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-indent_style: Block
-// rustfmt-max_width: 80
-// rustfmt-tab_spaces: 2
-
-// #1427
-fn main() {
-  exceptaions::config(move || {
-    (
-      NmiConfig {},
-      HardFaultConfig {},
-      SysTickConfig { gpio_sbsrr },
-    )
-  });
-}
diff --git a/tests/target/configs-fn_call_indent-block_trailing_comma.rs b/tests/target/configs-fn_call_indent-block_trailing_comma.rs
deleted file mode 100644 (file)
index a7e8590..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-error_on_line_overflow: false
-// rustfmt-indent_style: Block
-
-// rustfmt should not add trailing comma when rewriting macro. See #1528.
-fn a() {
-    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
-    foo(
-        a,
-        oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt(),
-    );
-}
diff --git a/tests/target/configs-fn_call_indent-visual.rs b/tests/target/configs-fn_call_indent-visual.rs
deleted file mode 100644 (file)
index 5454c44..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-indent_style: Visual
-// Function call style
-
-fn main() {
-    lorem("lorem",
-          "ipsum",
-          "dolor",
-          "sit",
-          "amet",
-          "consectetur",
-          "adipiscing",
-          "elit");
-}
diff --git a/tests/target/configs-fn_call_indent-visual_trailing_comma.rs b/tests/target/configs-fn_call_indent-visual_trailing_comma.rs
deleted file mode 100644 (file)
index 9738d39..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-error_on_line_overflow: false
-// rustfmt-indent_style: Visual
-
-// rustfmt should not add trailing comma when rewriting macro. See #1528.
-fn a() {
-    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
-}
diff --git a/tests/target/configs-fn_single_line-false.rs b/tests/target/configs-fn_single_line-false.rs
deleted file mode 100644 (file)
index 3d092f0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-fn_single_line: false
-// Single-expression function on single line
-
-fn lorem() -> usize {
-    42
-}
-
-fn lorem() -> usize {
-    let ipsum = 42;
-    ipsum
-}
diff --git a/tests/target/configs-fn_single_line-true.rs b/tests/target/configs-fn_single_line-true.rs
deleted file mode 100644 (file)
index 10d94e0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// rustfmt-fn_single_line: true
-// Single-expression function on single line
-
-fn lorem() -> usize { 42 }
-
-fn lorem() -> usize {
-    let ipsum = 42;
-    ipsum
-}
diff --git a/tests/target/configs-force_explicit_abi-false.rs b/tests/target/configs-force_explicit_abi-false.rs
deleted file mode 100644 (file)
index 3c48f8e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-force_explicit_abi: false
-// Force explicit abi
-
-extern {
-    pub static lorem: c_int;
-}
diff --git a/tests/target/configs-force_explicit_abi-true.rs b/tests/target/configs-force_explicit_abi-true.rs
deleted file mode 100644 (file)
index 90f5a8c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-force_explicit_abi: true
-// Force explicit abi
-
-extern "C" {
-    pub static lorem: c_int;
-}
diff --git a/tests/target/configs-force_multiline_block-false.rs b/tests/target/configs-force_multiline_block-false.rs
deleted file mode 100644 (file)
index 7cb4cac..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// rustfmt-force_multiline_blocks: false
-// Option forces multiline match arm and closure bodies to be wrapped in a block
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            if ipsum {
-                println!("dolor");
-            }
-        }
-        Lorem::Dolor => println!("amet"),
-    }
-}
-
-fn main() {
-    result.and_then(|maybe_value| match maybe_value {
-        None => Err("oops"),
-        Some(value) => Ok(1),
-    });
-}
diff --git a/tests/target/configs-force_multiline_block-true.rs b/tests/target/configs-force_multiline_block-true.rs
deleted file mode 100644 (file)
index aec50af..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// rustfmt-force_multiline_blocks: true
-// Option forces multiline match arm and closure bodies to be wrapped in a block
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            if ipsum {
-                println!("dolor");
-            }
-        }
-        Lorem::Dolor => println!("amet"),
-    }
-}
-
-fn main() {
-    result.and_then(|maybe_value| {
-        match maybe_value {
-            None => Err("oops"),
-            Some(value) => Ok(1),
-        }
-    });
-}
diff --git a/tests/target/configs-format_strings-false.rs b/tests/target/configs-format_strings-false.rs
deleted file mode 100644 (file)
index ecca0d7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// rustfmt-format_strings: false
-// rustfmt-max_width: 50
-// rustfmt-error_on_line_overflow: false
-// Force format strings
-
-fn main() {
-    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
-}
diff --git a/tests/target/configs-format_strings-true.rs b/tests/target/configs-format_strings-true.rs
deleted file mode 100644 (file)
index fdd5ab2..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// rustfmt-format_strings: true
-// rustfmt-max_width: 50
-// Force format strings
-
-fn main() {
-    let lorem = "ipsum dolor sit amet \
-                 consectetur adipiscing elit \
-                 lorem ipsum dolor sit";
-}
diff --git a/tests/target/configs-generics_indent-block.rs b/tests/target/configs-generics_indent-block.rs
deleted file mode 100644 (file)
index c4fcaaf..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// rustfmt-indent_style: Block
-// Generics indent
-
-fn lorem<
-    Ipsum: Eq = usize,
-    Dolor: Eq = usize,
-    Sit: Eq = usize,
-    Amet: Eq = usize,
-    Adipiscing: Eq = usize,
-    Consectetur: Eq = usize,
-    Elit: Eq = usize,
->(
-    ipsum: Ipsum,
-    dolor: Dolor,
-    sit: Sit,
-    amet: Amet,
-    adipiscing: Adipiscing,
-    consectetur: Consectetur,
-    elit: Elit,
-) -> T {
-    // body
-}
diff --git a/tests/target/configs-generics_indent-visual.rs b/tests/target/configs-generics_indent-visual.rs
deleted file mode 100644 (file)
index 491075a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// rustfmt-indent_style: Visual
-// Generics indent
-
-fn lorem<Ipsum: Eq = usize,
-         Dolor: Eq = usize,
-         Sit: Eq = usize,
-         Amet: Eq = usize,
-         Adipiscing: Eq = usize,
-         Consectetur: Eq = usize,
-         Elit: Eq = usize>(
-    ipsum: Ipsum,
-    dolor: Dolor,
-    sit: Sit,
-    amet: Amet,
-    adipiscing: Adipiscing,
-    consectetur: Consectetur,
-    elit: Elit)
-    -> T {
-    // body
-}
diff --git a/tests/target/configs-hard_tabs-false.rs b/tests/target/configs-hard_tabs-false.rs
deleted file mode 100644 (file)
index ccfb53d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-hard_tabs: false
-// Hard tabs
-
-fn lorem() -> usize {
-    42 // spaces before 42
-}
diff --git a/tests/target/configs-hard_tabs-true.rs b/tests/target/configs-hard_tabs-true.rs
deleted file mode 100644 (file)
index 3ed4e4f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-hard_tabs: true
-// Hard tabs
-
-fn lorem() -> usize {
-       42 // spaces before 42
-}
diff --git a/tests/target/configs-imports_indent-block.rs b/tests/target/configs-imports_indent-block.rs
deleted file mode 100644 (file)
index 84c3b26..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-imports_indent: Block
-
-use lists::{
-    definitive_tactic, itemize_list, shape_for_tactic, struct_lit_formatting, struct_lit_shape,
-    struct_lit_tactic, write_list, DefinitiveListTactic, ListFormatting, ListItem, ListTactic,
-    SeparatorTactic,
-};
diff --git a/tests/target/configs-imports_layout-horizontal_vertical.rs b/tests/target/configs-imports_layout-horizontal_vertical.rs
deleted file mode 100644 (file)
index 4a63556..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// rustfmt-imports_indent: Block
-// rustfmt-imports_layout: HorizontalVertical
-
-use comment::{contains_comment, recover_comment_removed, rewrite_comment, FindUncommented};
-use lists::{
-    definitive_tactic,
-    itemize_list,
-    shape_for_tactic,
-    struct_lit_formatting,
-    struct_lit_shape,
-    struct_lit_tactic,
-    write_list,
-    DefinitiveListTactic,
-    ListFormatting,
-    ListItem,
-    ListTactic,
-    SeparatorTactic,
-};
diff --git a/tests/target/configs-imports_layout-mixed.rs b/tests/target/configs-imports_layout-mixed.rs
deleted file mode 100644 (file)
index 5d3349a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// rustfmt-imports_indent: Block
-// rustfmt-imports_layout: Mixed
-
-use comment::{contains_comment, recover_comment_removed, rewrite_comment, FindUncommented};
-use lists::{
-    definitive_tactic, itemize_list, shape_for_tactic, struct_lit_formatting, struct_lit_shape,
-    struct_lit_tactic, write_list, DefinitiveListTactic, ListFormatting, ListItem, ListTactic,
-    SeparatorTactic,
-};
diff --git a/tests/target/configs-item_brace_style-always_next_line.rs b/tests/target/configs-item_brace_style-always_next_line.rs
deleted file mode 100644 (file)
index 38ed449..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// rustfmt-brace_style: AlwaysNextLine
-// Item brace style
-
-enum Foo {}
-
-struct Bar {}
-
-struct Lorem
-{
-    ipsum: bool,
-}
-
-struct Dolor<T>
-where
-    T: Eq,
-{
-    sit: T,
-}
-
-#[cfg(test)]
-mod tests
-{
-    #[test]
-    fn it_works()
-    {
-    }
-}
diff --git a/tests/target/configs-item_brace_style-prefer_same_line.rs b/tests/target/configs-item_brace_style-prefer_same_line.rs
deleted file mode 100644 (file)
index 5143d75..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// rustfmt-brace_style: PreferSameLine
-// Item brace style
-
-struct Lorem {
-    ipsum: bool,
-}
-
-struct Dolor<T>
-where
-    T: Eq, {
-    sit: T,
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn it_works() {}
-}
diff --git a/tests/target/configs-item_brace_style-same_line_where.rs b/tests/target/configs-item_brace_style-same_line_where.rs
deleted file mode 100644 (file)
index 8a3b285..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// rustfmt-brace_style: SameLineWhere
-// Item brace style
-
-struct Lorem {
-    ipsum: bool,
-}
-
-struct Dolor<T>
-where
-    T: Eq,
-{
-    sit: T,
-}
-
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn it_works() {}
-}
diff --git a/tests/target/configs-match_arm_blocks-false.rs b/tests/target/configs-match_arm_blocks-false.rs
deleted file mode 100644 (file)
index 4d53a96..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// rustfmt-match_arm_blocks: false
-// Wrap match-arms
-
-fn main() {
-    match lorem {
-        true =>
-            foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
-        false => println!("{}", sit),
-    }
-}
diff --git a/tests/target/configs-match_arm_blocks-true.rs b/tests/target/configs-match_arm_blocks-true.rs
deleted file mode 100644 (file)
index d75ef03..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_arm_blocks: true
-// Wrap match-arms
-
-fn main() {
-    match lorem {
-        true => {
-            foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
-        }
-        false => println!("{}", sit),
-    }
-}
diff --git a/tests/target/configs-match_block_trailing_comma-false.rs b/tests/target/configs-match_block_trailing_comma-false.rs
deleted file mode 100644 (file)
index 70e0295..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_block_trailing_comma: false
-// Match block trailing comma
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            println!("ipsum");
-        }
-        Lorem::Dolor => println!("dolor"),
-    }
-}
diff --git a/tests/target/configs-match_block_trailing_comma-true.rs b/tests/target/configs-match_block_trailing_comma-true.rs
deleted file mode 100644 (file)
index b78b046..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-match_block_trailing_comma: true
-// Match block trailing comma
-
-fn main() {
-    match lorem {
-        Lorem::Ipsum => {
-            println!("ipsum");
-        },
-        Lorem::Dolor => println!("dolor"),
-    }
-}
diff --git a/tests/target/configs-merge_derives-true.rs b/tests/target/configs-merge_derives-true.rs
deleted file mode 100644 (file)
index 4d0148b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// rustfmt-merge_derives: true
-// Merge multiple derives to a single one.
-
-#[bar]
-#[derive(Eq, PartialEq)]
-#[foo]
-#[derive(Debug)]
-#[foobar]
-#[derive(Copy, Clone)]
-pub enum Foo {}
-
-#[derive(Eq, PartialEq, Debug)]
-#[foobar]
-#[derive(Copy, Clone)]
-pub enum Bar {}
-
-#[derive(Eq, PartialEq, Debug, Copy, Clone)]
-pub enum FooBar {}
-
-mod foo {
-    #[bar]
-    #[derive(Eq, PartialEq)]
-    #[foo]
-    #[derive(Debug)]
-    #[foobar]
-    #[derive(Copy, Clone)]
-    pub enum Foo {}
-}
-
-mod bar {
-    #[derive(Eq, PartialEq, Debug)]
-    #[foobar]
-    #[derive(Copy, Clone)]
-    pub enum Bar {}
-}
-
-mod foobar {
-    #[derive(Eq, PartialEq, Debug, Copy, Clone)]
-    pub enum FooBar {}
-}
diff --git a/tests/target/configs-normalize_comments-false.rs b/tests/target/configs-normalize_comments-false.rs
deleted file mode 100644 (file)
index 488962e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-normalize_comments: false
-// Normalize comments
-
-// Lorem ipsum:
-fn dolor() -> usize {}
-
-/* sit amet: */
-fn adipiscing() -> usize {}
-
-// #652
-////////////////////////////////////////////////////////////////////////////////
-// Basic slice extension methods
-////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/target/configs-normalize_comments-true.rs b/tests/target/configs-normalize_comments-true.rs
deleted file mode 100644 (file)
index 0bdbe08..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-normalize_comments: true
-// Normalize comments
-
-// Lorem ipsum:
-fn dolor() -> usize {}
-
-// sit amet:
-fn adipiscing() -> usize {}
-
-// #652
-////////////////////////////////////////////////////////////////////////////////
-// Basic slice extension methods
-////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/target/configs-reorder_imported_names-false.rs b/tests/target/configs-reorder_imported_names-false.rs
deleted file mode 100644 (file)
index 91db89c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// rustfmt-reorder_imported_names: false
-// Reorder imported names
-
-use super::{lorem, ipsum, dolor, sit};
diff --git a/tests/target/configs-reorder_imported_names-true.rs b/tests/target/configs-reorder_imported_names-true.rs
deleted file mode 100644 (file)
index 59f55f4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// rustfmt-reorder_imported_names: true
-// Reorder imported names
-
-use super::{dolor, ipsum, lorem, sit};
diff --git a/tests/target/configs-reorder_imports-false.rs b/tests/target/configs-reorder_imports-false.rs
deleted file mode 100644 (file)
index 4b85684..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-reorder_imports: false
-// Reorder imports
-
-use lorem;
-use ipsum;
-use dolor;
-use sit;
diff --git a/tests/target/configs-reorder_imports-true.rs b/tests/target/configs-reorder_imports-true.rs
deleted file mode 100644 (file)
index e4ff729..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// rustfmt-reorder_imports: true
-// Reorder imports
-
-use dolor;
-use ipsum;
-use lorem;
-use sit;
-
-fn foo() {
-    use A;
-    use B;
-    use C;
-
-    bar();
-
-    use D;
-    use E;
-    use F;
-}
diff --git a/tests/target/configs-reorder_imports_in_group-false.rs b/tests/target/configs-reorder_imports_in_group-false.rs
deleted file mode 100644 (file)
index 29460da..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// rustfmt-reorder_imports: true
-// rustfmt-reorder_imports_in_group: false
-// Reorder imports in group
-
-use dolor;
-/// This comment should stay with `use ipsum;`
-use ipsum;
-use lorem;
-use sit;
-use std::io;
-/// This comment should stay with `use std::mem;`
-use std::mem;
diff --git a/tests/target/configs-reorder_imports_in_group-true.rs b/tests/target/configs-reorder_imports_in_group-true.rs
deleted file mode 100644 (file)
index c5e3536..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// rustfmt-reorder_imports: true
-// rustfmt-reorder_imports_in_group: true
-// Reorder imports in group
-
-use std::io;
-/// This comment should stay with `use std::mem;`
-use std::mem;
-
-use dolor;
-/// This comment should stay with `use ipsum;`
-use ipsum;
-use lorem;
-use sit;
diff --git a/tests/target/configs-same_line_attributes-false.rs b/tests/target/configs-same_line_attributes-false.rs
deleted file mode 100644 (file)
index 84ac351..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// rustfmt-same_line_attributes: false
-// Option to place attributes on the same line as fields and variants where possible
-
-enum Lorem {
-    #[serde(skip_serializing)]
-    Ipsum,
-    #[serde(skip_serializing)]
-    Dolor,
-    #[serde(skip_serializing)]
-    Amet,
-}
-
-struct Lorem {
-    #[serde(rename = "Ipsum")]
-    ipsum: usize,
-    #[serde(rename = "Dolor")]
-    dolor: usize,
-    #[serde(rename = "Amet")]
-    amet: usize,
-}
-
-// #1943
-pub struct Bzip2 {
-    #[serde(rename = "level")]
-    level: i32,
-}
diff --git a/tests/target/configs-same_line_attributes-true.rs b/tests/target/configs-same_line_attributes-true.rs
deleted file mode 100644 (file)
index c2d48bb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-same_line_attributes: true
-// Option to place attributes on the same line as fields and variants where possible
-
-enum Lorem {
-    #[serde(skip_serializing)] Ipsum,
-    #[serde(skip_serializing)] Dolor,
-    #[serde(skip_serializing)] Amet,
-}
-
-struct Lorem {
-    #[serde(rename = "Ipsum")] ipsum: usize,
-    #[serde(rename = "Dolor")] dolor: usize,
-    #[serde(rename = "Amet")] amet: usize,
-}
diff --git a/tests/target/configs-space_before_colon-true.rs b/tests/target/configs-space_before_colon-true.rs
deleted file mode 100644 (file)
index e2895b5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-space_before_colon: true
-// Space before colon
-
-fn lorem<T : Eq>(t : T) {
-    let ipsum : Dolor = sit;
-}
-
-const LOREM : Lorem = Lorem {
-    ipsum : dolor,
-    sit : amet,
-};
diff --git a/tests/target/configs-spaces_around_ranges-false.rs b/tests/target/configs-spaces_around_ranges-false.rs
deleted file mode 100644 (file)
index 3d431e4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_around_ranges: false
-// Spaces around ranges
-
-fn main() {
-    let lorem = 0..10;
-}
diff --git a/tests/target/configs-spaces_around_ranges-true.rs b/tests/target/configs-spaces_around_ranges-true.rs
deleted file mode 100644 (file)
index 2a456a6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-spaces_around_ranges: true
-// Spaces around ranges
-
-fn main() {
-    let lorem = 0 .. 10;
-}
diff --git a/tests/target/configs-spaces_within_parens_and_brackets-false.rs b/tests/target/configs-spaces_within_parens_and_brackets-false.rs
deleted file mode 100644 (file)
index 908373c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-spaces_within_parens_and_brackets: false
-// Spaces within parens and brackets
-
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-    let lorem: [usize; 2] = [ipsum, dolor];
-}
diff --git a/tests/target/configs-spaces_within_parens_and_brackets-true.rs b/tests/target/configs-spaces_within_parens_and_brackets-true.rs
deleted file mode 100644 (file)
index 7aff713..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-// rustfmt-spaces_within_parens_and_brackets: true
-// Spaces within parens and brackets
-
-fn lorem< T: Eq >( t: T ) {
-    let lorem = ( ipsum, dolor );
-    let lorem: [ usize; 2 ] = [ ipsum, dolor ];
-}
-
-enum E {
-    A( u32 ),
-    B( u32, u32 ),
-    C( u32, u32, u32 ),
-    D(),
-}
-
-struct TupleStruct0();
-struct TupleStruct1( u32 );
-struct TupleStruct2( u32, u32 );
-
-fn fooEmpty() {}
-
-fn foo( e: E, _: u32 ) -> ( u32, u32 ) {
-    // Tuples
-    let t1 = ();
-    let t2 = ( 1, );
-    let t3 = ( 1, 2 );
-
-    let ts0 = TupleStruct0();
-    let ts1 = TupleStruct1( 1 );
-    let ts2 = TupleStruct2( 1, 2 );
-
-    // Tuple pattern
-    let ( a, b, c ) = ( 1, 2, 3 );
-
-    // Expressions
-    let x = ( 1 + 2 ) * ( 3 );
-
-    // Function call
-    fooEmpty();
-    foo( 1, 2 );
-
-    // Pattern matching
-    match e {
-        A( _ ) => (),
-        B( _, _ ) => (),
-        C( .. ) => (),
-        D => (),
-    }
-
-    ( 1, 2 )
-}
-
-struct Foo< T > {
-    i: T,
-}
-
-struct Bar< T, E > {
-    i: T,
-    e: E,
-}
-
-struct Foo< 'a > {
-    i: &'a str,
-}
-
-enum E< T > {
-    T( T ),
-}
-
-enum E< T, S > {
-    T( T ),
-    S( S ),
-}
-
-fn foo< T >( a: T ) {
-    foo::< u32 >( 10 );
-}
-
-fn foo< T, E >( a: T, b: E ) {
-    foo::< u32, str >( 10, "bar" );
-}
-
-fn foo< T: Send, E: Send >( a: T, b: E ) {
-    foo::< u32, str >( 10, "bar" );
-
-    let opt: Option< u32 >;
-    let res: Result< u32, String >;
-}
-
-fn foo< 'a >( a: &'a str ) {
-    foo( "foo" );
-}
-
-fn foo< 'a, 'b >( a: &'a str, b: &'b str ) {
-    foo( "foo", "bar" );
-}
-
-impl Foo {
-    fn bar() {
-        < Foo as Foo >::bar();
-    }
-}
-
-trait MyTrait< A, D > {}
-impl< A: Send, D: Send > MyTrait< A, D > for Foo {}
-
-fn foo()
-where
-    for< 'a > u32: 'a,
-{
-}
-
-fn main() {
-    let arr: [ i32; 5 ] = [ 1, 2, 3, 4, 5 ];
-    let arr: [ i32; 500 ] = [ 0; 500 ];
-
-    let v = vec![ 1, 2, 3 ];
-    assert_eq!( arr, [ 1, 2, 3 ] );
-
-    let i = arr[ 0 ];
-
-    let slice = &arr[ 1..2 ];
-
-    let line100_________________________________________________________________________ = [ 1, 2 ];
-    let line101__________________________________________________________________________ =
-        [ 1, 2 ];
-    let line102___________________________________________________________________________ =
-        [ 1, 2 ];
-    let line103____________________________________________________________________________ =
-        [ 1, 2 ];
-    let line104_____________________________________________________________________________ =
-        [ 1, 2 ];
-
-    let line100_____________________________________________________________________ = vec![ 1, 2 ];
-    let line101______________________________________________________________________ =
-        vec![ 1, 2 ];
-    let line102_______________________________________________________________________ =
-        vec![ 1, 2 ];
-    let line103________________________________________________________________________ =
-        vec![ 1, 2 ];
-    let line104_________________________________________________________________________ =
-        vec![ 1, 2 ];
-}
-
-fn f( slice: &[ i32 ] ) {}
diff --git a/tests/target/configs-struct_field_align_threshold-20.rs b/tests/target/configs-struct_field_align_threshold-20.rs
deleted file mode 100644 (file)
index 7d8200a..0000000
+++ /dev/null
@@ -1,466 +0,0 @@
-// rustfmt-struct_field_align_threshold: 20
-// rustfmt-normalize_comments: true
-// rustfmt-wrap_comments: true
-// rustfmt-error_on_line_overflow: false
-
-struct Foo {
-    x:   u32,
-    yy:  u32, // comment
-    zzz: u32,
-}
-
-pub struct Bar {
-    x:   u32,
-    yy:  u32,
-    zzz: u32,
-
-    xxxxxxx: u32,
-}
-
-fn main() {
-    let foo = Foo {
-        x:   0,
-        yy:  1,
-        zzz: 2,
-    };
-
-    let bar = Bar {
-        x:   0,
-        yy:  1,
-        zzz: 2,
-
-        xxxxxxx: 3,
-    };
-}
-
-/// A Doc comment
-#[AnAttribute]
-pub struct Foo {
-    #[rustfmt_skip]
-    f :   SomeType, // Comment beside a field
-    f: SomeType, // Comment beside a field
-    // Comment on a field
-    #[AnAttribute] g: SomeOtherType,
-    /// A doc comment on a field
-    h: AThirdType,
-    pub i: TypeForPublicField,
-}
-
-// #1029
-pub struct Foo {
-    #[doc(hidden)]
-    // This will NOT get deleted!
-    bar: String, // hi
-}
-
-// #1029
-struct X {
-    // `x` is an important number.
-    #[allow(unused)] // TODO: use
-    x: u32,
-}
-
-// #410
-#[allow(missing_docs)]
-pub struct Writebatch<K: Key> {
-    #[allow(dead_code)] // only used for holding the internal pointer
-    writebatch: RawWritebatch,
-    marker: PhantomData<K>,
-}
-
-struct Bar;
-
-struct NewType(Type, OtherType);
-
-struct NewInt<T: Copy>(
-    pub i32,
-    SomeType, // inline comment
-    T,        // sup
-);
-
-struct Qux<
-    'a,
-    N: Clone + 'a,
-    E: Clone + 'a,
-    G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
-    W: Write + Copy,
->(
-    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
-    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
-    #[AnAttr]
-    // Comment
-    /// Testdoc
-    G,
-    pub W,
-);
-
-struct Tuple(
-    // Comment 1
-    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
-    // Comment 2
-    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
-);
-
-// With a where clause and generics.
-pub struct Foo<'a, Y: Baz>
-where
-    X: Whatever,
-{
-    f: SomeType, // Comment beside a field
-}
-
-struct Baz {
-    a: A, // Comment A
-    b: B, // Comment B
-    c: C, // Comment C
-}
-
-struct Baz {
-    a: A, // Comment A
-
-    b: B, // Comment B
-
-    c: C, // Comment C
-}
-
-struct Baz {
-    a: A,
-
-    b: B,
-    c: C,
-
-    d: D,
-}
-
-struct Baz {
-    // Comment A
-    a: A,
-
-    // Comment B
-    b: B,
-    // Comment C
-    c: C,
-}
-
-// Will this be a one-liner?
-struct Tuple(
-    A, // Comment
-    B,
-);
-
-pub struct State<F: FnMut() -> time::Timespec> {
-    now: F,
-}
-
-pub struct State<F: FnMut() -> ()> {
-    now: F,
-}
-
-pub struct State<F: FnMut()> {
-    now: F,
-}
-
-struct Palette {
-    /// A map of indices in the palette to a count of pixels in approximately
-    /// that color
-    foo: i32,
-}
-
-// Splitting a single line comment into a block previously had a misalignment
-// when the field had attributes
-struct FieldsWithAttributes {
-    // Pre Comment
-    #[rustfmt_skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
-                                      * BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
-    // Another pre comment
-    #[attr1]
-    #[attr2]
-    pub id: usize, /* CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC
-                    * CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC */
-}
-
-struct Deep {
-    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
-        node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>,
-}
-
-struct Foo<T>(T);
-struct Foo<T>(T)
-where
-    T: Copy,
-    T: Eq;
-struct Foo<T>(
-    TTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUUUUUUU,
-    TTTTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUU,
-);
-struct Foo<T>(
-    TTTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUUUUUUU,
-    TTTTTTTTTTTTTTTTTTT,
-)
-where
-    T: PartialEq;
-struct Foo<T>(
-    TTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUUUUUUU,
-    TTTTTTTTTTTTTTTTTTTTT,
-)
-where
-    T: PartialEq;
-struct Foo<T>(
-    TTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUUUUUUU,
-    TTTTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUU,
-)
-where
-    T: PartialEq;
-struct Foo<T>(
-    TTTTTTTTTTTTTTTTT,        // Foo
-    UUUUUUUUUUUUUUUUUUUUUUUU, // Bar
-    // Baz
-    TTTTTTTTTTTTTTTTTTT,
-    // Qux (FIXME #572 - doc comment)
-    UUUUUUUUUUUUUUUUUUU,
-);
-
-mod m {
-    struct X<T>
-    where
-        T: Sized,
-    {
-        a: T,
-    }
-}
-
-struct Foo<T>(
-    TTTTTTTTTTTTTTTTTTT,
-    /// Qux
-    UUUUUUUUUUUUUUUUUUU,
-);
-
-struct Issue677 {
-    pub ptr:   *const libc::c_void,
-    pub trace: fn(obj: *const libc::c_void, tracer: *mut JSTracer),
-}
-
-struct Foo {}
-struct Foo {}
-struct Foo {
-    // comment
-}
-struct Foo {
-    // trailing space ->
-}
-struct Foo { /* comment */ }
-struct Foo( /* comment */ );
-
-struct LongStruct {
-    a: A,
-    the_quick_brown_fox_jumps_over_the_lazy_dog:
-        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
-}
-
-struct Deep {
-    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
-        node::Handle<IdRef<'id, Node<Key, Value>>, Type, NodeType>,
-}
-
-struct Foo<C = ()>(String);
-
-// #1364
-fn foo() {
-    convex_shape.set_point(0, &Vector2f { x: 400.0, y: 100.0 });
-    convex_shape.set_point(1, &Vector2f { x: 500.0, y: 70.0 });
-    convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
-    convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
-}
-
-fn main() {
-    let x = Bar;
-
-    // Comment
-    let y = Foo { a: x };
-
-    Foo {
-        a: foo(), // comment
-        // comment
-        b: bar(),
-        ..something
-    };
-
-    Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b() };
-
-    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
-        a: f(),
-        b: b(),
-    };
-
-    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
-        // Comment
-        a: foo(), // Comment
-        // Comment
-        b: bar(), // Comment
-    };
-
-    Foo { a: Bar, b: f() };
-
-    Quux {
-        x: if cond {
-            bar();
-        },
-        y: baz(),
-    };
-
-    A {
-        // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
-        // amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
-        // hendrerit. Donec et mollis dolor.
-        first: item(),
-        // Praesent et diam eget libero egestas mattis sit amet vitae augue.
-        // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
-        second: Item,
-    };
-
-    Some(Data::MethodCallData(MethodCallData {
-        span:    sub_span.unwrap(),
-        scope:   self.enclosing_scope(id),
-        ref_id:  def_id,
-        decl_id: Some(decl_id),
-    }));
-
-    Diagram {
-        //                 o        This graph demonstrates how
-        //                / \       significant whitespace is
-        //               o   o      preserved.
-        //              /|\   \
-        //             o o o   o
-        graph: G,
-    }
-}
-
-fn matcher() {
-    TagTerminatedByteMatcher {
-        matcher: ByteMatcher {
-            pattern: b"<HTML",
-            mask:    b"\xFF\xDF\xDF\xDF\xDF\xFF",
-        },
-    };
-}
-
-fn issue177() {
-    struct Foo<T> {
-        memb: T,
-    }
-    let foo = Foo::<i64> { memb: 10 };
-}
-
-fn issue201() {
-    let s = S { a: 0, ..b };
-}
-
-fn issue201_2() {
-    let s = S { a: S2 { ..c }, ..b };
-}
-
-fn issue278() {
-    let s = S {
-        a: 0,
-        //
-        b: 0,
-    };
-    let s1 = S {
-        a: 0,
-        // foo
-        //
-        // bar
-        b: 0,
-    };
-}
-
-fn struct_exprs() {
-    Foo { a: 1, b: f(2) };
-    Foo {
-        a: 1,
-        b: f(2),
-        ..g(3)
-    };
-    LoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongStruct {
-        ..base
-    };
-    IntrinsicISizesContribution {
-        content_intrinsic_sizes: IntrinsicISizes {
-            minimum_inline_size: 0,
-        },
-    };
-}
-
-fn issue123() {
-    Foo { a: b, c: d, e: f };
-
-    Foo {
-        a: bb,
-        c: dd,
-        e: ff,
-    };
-
-    Foo {
-        a: ddddddddddddddddddddd,
-        b: cccccccccccccccccccccccccccccccccccccc,
-    };
-}
-
-fn issue491() {
-    Foo {
-        guard: None,
-        arm:   0, // Comment
-    };
-
-    Foo {
-        arm: 0, // Comment
-    };
-
-    Foo {
-        a: aaaaaaaaaa,
-        b: bbbbbbbb,
-        c: cccccccccc,
-        d: dddddddddd, // a comment
-        e: eeeeeeeee,
-    };
-}
-
-fn issue698() {
-    Record {
-        ffffffffffffffffffffffffffields: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-    };
-    Record {
-        ffffffffffffffffffffffffffields:
-            aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-    }
-}
-
-fn issue835() {
-    MyStruct {};
-    MyStruct { /* a comment */ };
-    MyStruct {
-        // Another comment
-    };
-    MyStruct {}
-}
-
-fn field_init_shorthand() {
-    MyStruct { x, y, z };
-    MyStruct { x, y, z, ..base };
-    Foo {
-        aaaaaaaaaa,
-        bbbbbbbb,
-        cccccccccc,
-        dddddddddd, // a comment
-        eeeeeeeee,
-    };
-    Record {
-        ffffffffffffffffffffffffffieldsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
-    };
-}
diff --git a/tests/target/configs-struct_lit_indent-block.rs b/tests/target/configs-struct_lit_indent-block.rs
deleted file mode 100644 (file)
index 656b562..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// rustfmt-indent_style: Block
-// Struct literal-style
-
-fn main() {
-    let lorem = Lorem {
-        ipsum: dolor,
-        sit: amet,
-    };
-}
diff --git a/tests/target/configs-struct_lit_indent-visual.rs b/tests/target/configs-struct_lit_indent-visual.rs
deleted file mode 100644 (file)
index b4effba..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// rustfmt-indent_style: Visual
-// Struct literal-style
-
-fn main() {
-    let lorem = Lorem { ipsum: dolor,
-                        sit: amet, };
-}
diff --git a/tests/target/configs-struct_lit_single_line-false.rs b/tests/target/configs-struct_lit_single_line-false.rs
deleted file mode 100644 (file)
index e2732b5..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// rustfmt-struct_lit_single_line: false
-// Struct literal multiline-style
-
-fn main() {
-    let lorem = Lorem {
-        ipsum: dolor,
-        sit: amet,
-    };
-}
diff --git a/tests/target/configs-tab_spaces-2.rs b/tests/target/configs-tab_spaces-2.rs
deleted file mode 100644 (file)
index 8596170..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-tab_spaces: 2
-// rustfmt-max_width: 30
-// rustfmt-indent_style: Block
-// Tab spaces
-
-fn lorem() {
-  let ipsum = dolor();
-  let sit = vec![
-    "amet",
-    "consectetur",
-    "adipiscing",
-    "elit.",
-  ];
-}
diff --git a/tests/target/configs-tab_spaces-4.rs b/tests/target/configs-tab_spaces-4.rs
deleted file mode 100644 (file)
index 524a551..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-tab_spaces: 4
-// rustfmt-max_width: 30
-// rustfmt-indent_style: Block
-// Tab spaces
-
-fn lorem() {
-    let ipsum = dolor();
-    let sit = vec![
-        "amet",
-        "consectetur",
-        "adipiscing",
-        "elit.",
-    ];
-}
diff --git a/tests/target/configs-trailing_comma-always.rs b/tests/target/configs-trailing_comma-always.rs
deleted file mode 100644 (file)
index 951dc68..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-trailing_comma: Always
-// Trailing comma
-
-fn main() {
-    let Lorem { ipsum, dolor, sit, } = amet;
-    let Lorem {
-        ipsum,
-        dolor,
-        sit,
-        amet,
-        consectetur,
-        adipiscing,
-    } = elit;
-}
diff --git a/tests/target/configs-trailing_comma-never.rs b/tests/target/configs-trailing_comma-never.rs
deleted file mode 100644 (file)
index ae0e50f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// rustfmt-trailing_comma: Never
-// Trailing comma
-
-fn main() {
-    let Lorem { ipsum, dolor, sit } = amet;
-    let Lorem {
-        ipsum,
-        dolor,
-        sit,
-        amet,
-        consectetur,
-        adipiscing
-    } = elit;
-
-    // #1544
-    if let VrMsg::ClientReply {
-        request_num: reply_req_num,
-        value,
-        ..
-    } = msg
-    {
-        let _ = safe_assert_eq!(reply_req_num, request_num, op);
-        return Ok((request_num, op, value));
-    }
-
-    // #1710
-    pub struct FileInput {
-        input: StringInput,
-        file_name: OsString
-    }
-    match len {
-        Some(len) => Ok(new(self.input, self.pos + len)),
-        None => Err(self)
-    }
-}
diff --git a/tests/target/configs-trailing_comma-vertical.rs b/tests/target/configs-trailing_comma-vertical.rs
deleted file mode 100644 (file)
index 7283cde..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// rustfmt-trailing_comma: Vertical
-// Trailing comma
-
-fn main() {
-    let Lorem { ipsum, dolor, sit } = amet;
-    let Lorem {
-        ipsum,
-        dolor,
-        sit,
-        amet,
-        consectetur,
-        adipiscing,
-    } = elit;
-}
diff --git a/tests/target/configs-trailing_semicolon-false.rs b/tests/target/configs-trailing_semicolon-false.rs
deleted file mode 100644 (file)
index 9fa746e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// rustfmt-trailing_semicolon: false
-
-#![feature(loop_break_value)]
-
-fn main() {
-    'a: loop {
-        break 'a
-    }
-
-    let mut done = false;
-    'b: while !done {
-        done = true;
-        continue 'b
-    }
-
-    let x = loop {
-        break 5
-    };
-
-    let x = 'c: loop {
-        break 'c 5
-    };
-}
-
-fn foo() -> usize {
-    return 0
-}
diff --git a/tests/target/configs-trailing_semicolon-true.rs b/tests/target/configs-trailing_semicolon-true.rs
deleted file mode 100644 (file)
index 61b6843..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-// rustfmt-trailing_semicolon: true
-
-#![feature(loop_break_value)]
-
-fn main() {
-    'a: loop {
-        break 'a;
-    }
-
-    let mut done = false;
-    'b: while !done {
-        done = true;
-        continue 'b;
-    }
-
-    let x = loop {
-        break 5;
-    };
-
-    let x = 'c: loop {
-        break 'c 5;
-    };
-}
-
-fn foo() -> usize {
-    return 0;
-}
diff --git a/tests/target/configs-type_punctuation_density-compressed.rs b/tests/target/configs-type_punctuation_density-compressed.rs
deleted file mode 100644 (file)
index 4b3e02e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-type_punctuation_density: Compressed
-// Type punctuation density
-
-fn lorem<Ipsum: Dolor+Sit=Amet>() {
-    // body
-}
diff --git a/tests/target/configs-type_punctuation_density-wide.rs b/tests/target/configs-type_punctuation_density-wide.rs
deleted file mode 100644 (file)
index 8909036..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-type_punctuation_density: Wide
-// Type punctuation density
-
-fn lorem<Ipsum: Dolor + Sit = Amet>() {
-    // body
-}
diff --git a/tests/target/configs-use_try_shorthand-false.rs b/tests/target/configs-use_try_shorthand-false.rs
deleted file mode 100644 (file)
index de7f8b4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-use_try_shorthand: false
-// Use try! shorthand
-
-fn main() {
-    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
-}
diff --git a/tests/target/configs-use_try_shorthand-true.rs b/tests/target/configs-use_try_shorthand-true.rs
deleted file mode 100644 (file)
index d3aa035..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// rustfmt-use_try_shorthand: true
-// Use try! shorthand
-
-fn main() {
-    let lorem = ipsum.map(|dolor| dolor.sit())?;
-}
diff --git a/tests/target/configs-where_pred_indent-block.rs b/tests/target/configs-where_pred_indent-block.rs
deleted file mode 100644 (file)
index ad7e0b8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// rustfmt-indent_style: Block
-// Where predicate indent
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
-where
-    Ipsum: Eq,
-    Dolor: Eq,
-    Sit: Eq,
-    Amet: Eq,
-{
-    // body
-}
diff --git a/tests/target/configs-where_pred_indent-visual.rs b/tests/target/configs-where_pred_indent-visual.rs
deleted file mode 100644 (file)
index 45799dc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-indent_style: Visual
-// Where predicate indent
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
-    where Ipsum: Eq,
-          Dolor: Eq,
-          Sit: Eq,
-          Amet: Eq
-{
-    // body
-}
diff --git a/tests/target/configs-where_single_line-true.rs b/tests/target/configs-where_single_line-true.rs
deleted file mode 100644 (file)
index c4a7f5d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// rustfmt-where_single_line: true
-// Where style
-
-fn lorem_two_items<Ipsum, Dolor, Sit, Amet>() -> T
-where
-    Ipsum: Eq,
-    Lorem: Eq,
-{
-    // body
-}
-
-fn lorem_multi_line<Ipsum, Dolor, Sit, Amet>(
-    a: Aaaaaaaaaaaaaaa,
-    b: Bbbbbbbbbbbbbbbb,
-    c: Ccccccccccccccccc,
-    d: Ddddddddddddddddddddddddd,
-    e: Eeeeeeeeeeeeeeeeeee,
-) -> T
-where
-    Ipsum: Eq,
-{
-    // body
-}
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
-where Ipsum: Eq {
-    // body
-}
diff --git a/tests/target/configs-where_style-default.rs b/tests/target/configs-where_style-default.rs
deleted file mode 100644 (file)
index a8f0902..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// rustfmt-indent_style: Visual
-// Where style
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
-    where Ipsum: Eq,
-          Dolor: Eq,
-          Sit: Eq,
-          Amet: Eq
-{
-    // body
-}
diff --git a/tests/target/configs-where_style-rfc.rs b/tests/target/configs-where_style-rfc.rs
deleted file mode 100644 (file)
index a7b9a4f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// rustfmt-indent_style: Block
-// Where style
-
-fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
-where
-    Ipsum: Eq,
-    Dolor: Eq,
-    Sit: Eq,
-    Amet: Eq,
-{
-    // body
-}
diff --git a/tests/target/configs-wrap_comments-false.rs b/tests/target/configs-wrap_comments-false.rs
deleted file mode 100644 (file)
index 48ecd88..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-// rustfmt-wrap_comments: false
-// rustfmt-max_width: 50
-// rustfmt-error_on_line_overflow: false
-// Wrap comments
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-}
diff --git a/tests/target/configs-wrap_comments-true.rs b/tests/target/configs-wrap_comments-true.rs
deleted file mode 100644 (file)
index 4096fd4..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// rustfmt-wrap_comments: true
-// rustfmt-max_width: 50
-// Wrap comments
-
-fn main() {
-    // Lorem ipsum dolor sit amet, consectetur
-    // adipiscing elit, sed do eiusmod tempor
-    // incididunt ut labore et dolore magna
-    // aliqua. Ut enim ad minim veniam, quis
-    // nostrud exercitation ullamco laboris nisi
-    // ut aliquip ex ea commodo consequat.
-}
-
-fn code_block() {
-    // ```rust
-    // let x = 3;
-    //
-    // println!("x = {}", x);
-    // ```
-}
diff --git a/tests/target/configs/array_indent/block.rs b/tests/target/configs/array_indent/block.rs
new file mode 100644 (file)
index 0000000..5d45824
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-indent_style: Block
+// Array layout
+
+fn main() {
+    let lorem = vec![
+        "ipsum",
+        "dolor",
+        "sit",
+        "amet",
+        "consectetur",
+        "adipiscing",
+        "elit",
+    ];
+}
diff --git a/tests/target/configs/array_indent/visual.rs b/tests/target/configs/array_indent/visual.rs
new file mode 100644 (file)
index 0000000..1da6ff2
--- /dev/null
@@ -0,0 +1,12 @@
+// rustfmt-indent_style: Visual
+// Array layout
+
+fn main() {
+    let lorem = vec!["ipsum",
+                     "dolor",
+                     "sit",
+                     "amet",
+                     "consectetur",
+                     "adipiscing",
+                     "elit"];
+}
diff --git a/tests/target/configs/blank_lines_lower_bound/1.rs b/tests/target/configs/blank_lines_lower_bound/1.rs
new file mode 100644 (file)
index 0000000..9706699
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-blank_lines_lower_bound: 1
+
+fn foo() {}
+
+fn bar() {}
+
+// comment
+fn foobar() {}
+
+fn foo1() {}
+
+fn bar1() {}
+
+// comment
+
+fn foobar1() {}
diff --git a/tests/target/configs/chain_indent/block.rs b/tests/target/configs/chain_indent/block.rs
new file mode 100644 (file)
index 0000000..23340a4
--- /dev/null
@@ -0,0 +1,12 @@
+// rustfmt-indent_style: Block
+// Chain indent
+
+fn main() {
+    let lorem = ipsum
+        .dolor()
+        .sit()
+        .amet()
+        .consectetur()
+        .adipiscing()
+        .elite();
+}
diff --git a/tests/target/configs/chain_indent/visual.rs b/tests/target/configs/chain_indent/visual.rs
new file mode 100644 (file)
index 0000000..569f3d8
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-indent_style: Visual
+// Chain indent
+
+fn main() {
+    let lorem = ipsum.dolor()
+                     .sit()
+                     .amet()
+                     .consectetur()
+                     .adipiscing()
+                     .elite();
+}
diff --git a/tests/target/configs/combine_control_expr/false.rs b/tests/target/configs/combine_control_expr/false.rs
new file mode 100644 (file)
index 0000000..81eff08
--- /dev/null
@@ -0,0 +1,133 @@
+// rustfmt-indent_style: Block
+// rustfmt-combine_control_expr: false
+// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.
+
+fn main() {
+    // Call
+    foo(bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Mac
+    foo(foo!(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // MethodCall
+    foo(x.foo::<Bar, Baz>(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Block
+    foo!({
+        foo();
+        bar();
+    });
+
+    // Closure
+    foo(|x| {
+        let y = x + 1;
+        y
+    });
+
+    // Match
+    foo(match opt {
+        Some(x) => x,
+        None => y,
+    });
+
+    // Struct
+    foo(Bar {
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    });
+
+    // If
+    foo!(
+        if x {
+            foo();
+        } else {
+            bar();
+        }
+    );
+
+    // IfLet
+    foo!(
+        if let Some(..) = x {
+            foo();
+        } else {
+            bar();
+        }
+    );
+
+    // While
+    foo!(
+        while x {
+            foo();
+            bar();
+        }
+    );
+
+    // WhileLet
+    foo!(
+        while let Some(..) = x {
+            foo();
+            bar();
+        }
+    );
+
+    // ForLoop
+    foo!(
+        for x in y {
+            foo();
+            bar();
+        }
+    );
+
+    // Loop
+    foo!(
+        loop {
+            foo();
+            bar();
+        }
+    );
+
+    // Tuple
+    foo((
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // AddrOf
+    foo(&bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Box
+    foo(box Bar {
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    });
+
+    // Unary
+    foo(!bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Try
+    foo(bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    )?);
+
+    // Cast
+    foo(Bar {
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
+    } as i64);
+}
diff --git a/tests/target/configs/combine_control_expr/true.rs b/tests/target/configs/combine_control_expr/true.rs
new file mode 100644 (file)
index 0000000..c5372c2
--- /dev/null
@@ -0,0 +1,121 @@
+// rustfmt-indent_style: Block
+// rustfmt-combine_control_expr: true
+// Combining openings and closings. See https://github.com/rust-lang-nursery/fmt-rfcs/issues/61.
+
+fn main() {
+    // Call
+    foo(bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Mac
+    foo(foo!(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // MethodCall
+    foo(x.foo::<Bar, Baz>(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Block
+    foo!({
+        foo();
+        bar();
+    });
+
+    // Closure
+    foo(|x| {
+        let y = x + 1;
+        y
+    });
+
+    // Match
+    foo(match opt {
+        Some(x) => x,
+        None => y,
+    });
+
+    // Struct
+    foo(Bar {
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    });
+
+    // If
+    foo!(if x {
+        foo();
+    } else {
+        bar();
+    });
+
+    // IfLet
+    foo!(if let Some(..) = x {
+        foo();
+    } else {
+        bar();
+    });
+
+    // While
+    foo!(while x {
+        foo();
+        bar();
+    });
+
+    // WhileLet
+    foo!(while let Some(..) = x {
+        foo();
+        bar();
+    });
+
+    // ForLoop
+    foo!(for x in y {
+        foo();
+        bar();
+    });
+
+    // Loop
+    foo!(loop {
+        foo();
+        bar();
+    });
+
+    // Tuple
+    foo((
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // AddrOf
+    foo(&bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Box
+    foo(box Bar {
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    });
+
+    // Unary
+    foo(!bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    ));
+
+    // Try
+    foo(bar(
+        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+    )?);
+
+    // Cast
+    foo(Bar {
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
+    } as i64);
+}
diff --git a/tests/target/configs/comment_width/above.rs b/tests/target/configs/comment_width/above.rs
new file mode 100644 (file)
index 0000000..ddfecda
--- /dev/null
@@ -0,0 +1,8 @@
+// rustfmt-comment_width: 40
+// rustfmt-wrap_comments: true
+// Comment width
+
+fn main() {
+    // Lorem ipsum dolor sit amet,
+    // consectetur adipiscing elit.
+}
diff --git a/tests/target/configs/comment_width/below.rs b/tests/target/configs/comment_width/below.rs
new file mode 100644 (file)
index 0000000..abbc593
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-comment_width: 80
+// rustfmt-wrap_comments: true
+// Comment width
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+}
diff --git a/tests/target/configs/comment_width/ignore.rs b/tests/target/configs/comment_width/ignore.rs
new file mode 100644 (file)
index 0000000..c86e71c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-comment_width: 40
+// rustfmt-wrap_comments: false
+// Comment width
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+}
diff --git a/tests/target/configs/condense_wildcard_suffices/false.rs b/tests/target/configs/condense_wildcard_suffices/false.rs
new file mode 100644 (file)
index 0000000..3b967f3
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-condense_wildcard_suffixes: false
+// Condense wildcard suffixes
+
+fn main() {
+    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+}
diff --git a/tests/target/configs/condense_wildcard_suffices/true.rs b/tests/target/configs/condense_wildcard_suffices/true.rs
new file mode 100644 (file)
index 0000000..4f880ab
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-condense_wildcard_suffixes: true
+// Condense wildcard suffixes
+
+fn main() {
+    let (lorem, ipsum, ..) = (1, 2, 3, 4);
+}
diff --git a/tests/target/configs/control_brace_style/always_next_line.rs b/tests/target/configs/control_brace_style/always_next_line.rs
new file mode 100644 (file)
index 0000000..7dc06f2
--- /dev/null
@@ -0,0 +1,18 @@
+// rustfmt-control_brace_style: AlwaysNextLine
+// Control brace style
+
+fn main() {
+    if lorem
+    {
+        println!("ipsum!");
+    }
+    else
+    {
+        println!("dolor!");
+    }
+    match magi
+    {
+        Homura => "Akemi",
+        Madoka => "Kaname",
+    }
+}
diff --git a/tests/target/configs/control_brace_style/always_same_line.rs b/tests/target/configs/control_brace_style/always_same_line.rs
new file mode 100644 (file)
index 0000000..993b6b6
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-control_brace_style: AlwaysSameLine
+// Control brace style
+
+fn main() {
+    if lorem {
+        println!("ipsum!");
+    } else {
+        println!("dolor!");
+    }
+    match magi {
+        Homura => "Akemi",
+        Madoka => "Kaname",
+    }
+}
diff --git a/tests/target/configs/control_brace_style/closing_next_line.rs b/tests/target/configs/control_brace_style/closing_next_line.rs
new file mode 100644 (file)
index 0000000..013852e
--- /dev/null
@@ -0,0 +1,15 @@
+// rustfmt-control_brace_style: ClosingNextLine
+// Control brace style
+
+fn main() {
+    if lorem {
+        println!("ipsum!");
+    }
+    else {
+        println!("dolor!");
+    }
+    match magi {
+        Homura => "Akemi",
+        Madoka => "Kaname",
+    }
+}
diff --git a/tests/target/configs/control_style/rfc.rs b/tests/target/configs/control_style/rfc.rs
new file mode 100644 (file)
index 0000000..6619d8b
--- /dev/null
@@ -0,0 +1,39 @@
+// rustfmt-indent_style: Block
+
+// #1618
+fn main() {
+    loop {
+        if foo {
+            if ((right_paddle_speed < 0.) && (right_paddle.position().y - paddle_size.y / 2. > 5.))
+                || ((right_paddle_speed > 0.)
+                    && (right_paddle.position().y + paddle_size.y / 2. < game_height as f32 - 5.))
+            {
+                foo
+            }
+            if ai_timer.elapsed_time().as_microseconds() > ai_time.as_microseconds() {
+                if ball.position().y + ball_radius > right_paddle.position().y + paddle_size.y / 2.
+                {
+                    foo
+                }
+            }
+        }
+    }
+}
+
+fn issue1656() {
+    {
+        {
+            match rewrite {
+                Some(ref body_str)
+                    if (!body_str.contains('\n') && body_str.len() <= arm_shape.width)
+                        || !context.config.match_arm_blocks()
+                        || (extend && first_line_width(body_str) <= arm_shape.width)
+                        || is_block =>
+                {
+                    return None;
+                }
+                _ => {}
+            }
+        }
+    }
+}
diff --git a/tests/target/configs/disable_all_formatting/false.rs b/tests/target/configs/disable_all_formatting/false.rs
new file mode 100644 (file)
index 0000000..1a0477d
--- /dev/null
@@ -0,0 +1,10 @@
+// rustfmt-disable_all_formatting: false
+// Disable all formatting
+
+fn main() {
+    if lorem {
+        println!("ipsum!");
+    } else {
+        println!("dolor!");
+    }
+}
diff --git a/tests/target/configs/disable_all_formatting/true.rs b/tests/target/configs/disable_all_formatting/true.rs
new file mode 100644 (file)
index 0000000..736ccf5
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-disable_all_formatting: true
+// Disable all formatting
+
+fn main() {
+    if lorem{println!("ipsum!");}else{println!("dolor!");}
+}
diff --git a/tests/target/configs/empty_item_single_line/false.rs b/tests/target/configs/empty_item_single_line/false.rs
new file mode 100644 (file)
index 0000000..b7886df
--- /dev/null
@@ -0,0 +1,15 @@
+// rustfmt-empty_item_single_line: false
+// Empty impl on single line
+
+impl Lorem {
+}
+
+impl Ipsum {
+}
+
+fn lorem() {
+}
+
+fn lorem() {
+
+}
diff --git a/tests/target/configs/empty_item_single_line/true.rs b/tests/target/configs/empty_item_single_line/true.rs
new file mode 100644 (file)
index 0000000..0755485
--- /dev/null
@@ -0,0 +1,10 @@
+// rustfmt-empty_item_single_line: true
+// Empty impl on single line
+
+impl Lorem {}
+
+impl Ipsum {}
+
+fn lorem() {}
+
+fn lorem() {}
diff --git a/tests/target/configs/error_on_line_overflow/false.rs b/tests/target/configs/error_on_line_overflow/false.rs
new file mode 100644 (file)
index 0000000..fa70ae7
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-error_on_line_overflow: false
+// Error on line overflow
+
+fn main() {
+    let lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit_lorem_ipsum_dolor_sit_amet_consectetur_adipiscing_elit;
+}
diff --git a/tests/target/configs/error_on_unformatted/false.rs b/tests/target/configs/error_on_unformatted/false.rs
new file mode 100644 (file)
index 0000000..6a78374
--- /dev/null
@@ -0,0 +1,12 @@
+// rustfmt-error_on_unformatted: false
+// Error on line overflow comment or string literals.
+
+// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+fn main() {
+    // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+    let x = "                                                                                                  ";
+    let a = "
+  
+";
+}
diff --git a/tests/target/configs/fn_args_density/compressed.rs b/tests/target/configs/fn_args_density/compressed.rs
new file mode 100644 (file)
index 0000000..9928372
--- /dev/null
@@ -0,0 +1,22 @@
+// rustfmt-fn_args_density: Compressed
+// Function arguments density
+
+trait Lorem {
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
+        // body
+    }
+
+    fn lorem(
+        ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
+        adipiscing: Adipiscing, elit: Elit,
+    );
+
+    fn lorem(
+        ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, consectetur: onsectetur,
+        adipiscing: Adipiscing, elit: Elit,
+    ) {
+        // body
+    }
+}
diff --git a/tests/target/configs/fn_args_density/tall.rs b/tests/target/configs/fn_args_density/tall.rs
new file mode 100644 (file)
index 0000000..6ee43b4
--- /dev/null
@@ -0,0 +1,32 @@
+// rustfmt-fn_args_density: Tall
+// Function arguments density
+
+trait Lorem {
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet);
+
+    fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet) {
+        // body
+    }
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+        consectetur: onsectetur,
+        adipiscing: Adipiscing,
+        elit: Elit,
+    );
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+        consectetur: onsectetur,
+        adipiscing: Adipiscing,
+        elit: Elit,
+    ) {
+        // body
+    }
+}
diff --git a/tests/target/configs/fn_args_density/vertical.rs b/tests/target/configs/fn_args_density/vertical.rs
new file mode 100644 (file)
index 0000000..d48b349
--- /dev/null
@@ -0,0 +1,42 @@
+// rustfmt-fn_args_density: Vertical
+// Function arguments density
+
+trait Lorem {
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+    );
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+    ) {
+        // body
+    }
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+        consectetur: onsectetur,
+        adipiscing: Adipiscing,
+        elit: Elit,
+    );
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+        consectetur: onsectetur,
+        adipiscing: Adipiscing,
+        elit: Elit,
+    ) {
+        // body
+    }
+}
diff --git a/tests/target/configs/fn_args_indent/block.rs b/tests/target/configs/fn_args_indent/block.rs
new file mode 100644 (file)
index 0000000..80f4e13
--- /dev/null
@@ -0,0 +1,47 @@
+// rustfmt-indent_style: Block
+// Function arguments layout
+
+fn lorem() {}
+
+fn lorem(ipsum: usize) {}
+
+fn lorem(
+    ipsum: usize,
+    dolor: usize,
+    sit: usize,
+    amet: usize,
+    consectetur: usize,
+    adipiscing: usize,
+    elit: usize,
+) {
+    // body
+}
+
+// #1441
+extern "system" {
+    pub fn GetConsoleHistoryInfo(
+        console_history_info: *mut ConsoleHistoryInfo,
+    ) -> Boooooooooooooool;
+}
+
+// rustfmt should not add trailing comma for variadic function. See #1623.
+extern "C" {
+    pub fn variadic_fn(
+        first_parameter: FirstParameterType,
+        second_parameter: SecondParameterType,
+        ...
+    );
+}
+
+// #1652
+fn deconstruct(
+    foo: Bar,
+) -> (
+    SocketAddr,
+    Header,
+    Method,
+    RequestUri,
+    HttpVersion,
+    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
+) {
+}
diff --git a/tests/target/configs/fn_args_indent/visual.rs b/tests/target/configs/fn_args_indent/visual.rs
new file mode 100644 (file)
index 0000000..04c2eae
--- /dev/null
@@ -0,0 +1,40 @@
+// rustfmt-indent_style: Visual
+// Function arguments layout
+
+fn lorem() {}
+
+fn lorem(ipsum: usize) {}
+
+fn lorem(ipsum: usize,
+         dolor: usize,
+         sit: usize,
+         amet: usize,
+         consectetur: usize,
+         adipiscing: usize,
+         elit: usize) {
+    // body
+}
+
+// #1922
+extern "C" {
+    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
+                                    uplo: c_char,
+                                    n: lapack_int,
+                                    nrhs: lapack_int,
+                                    a: *const lapack_complex_float,
+                                    lda: lapack_int,
+                                    ipiv: *const lapack_int,
+                                    b: *mut lapack_complex_float,
+                                    ldb: lapack_int)
+                                    -> lapack_int;
+
+    pub fn LAPACKE_csytrs_rook_work(matrix_layout: c_int,
+                                    uplo: c_char,
+                                    n: lapack_int,
+                                    nrhs: lapack_int,
+                                    lda: lapack_int,
+                                    ipiv: *const lapack_int,
+                                    b: *mut lapack_complex_float,
+                                    ldb: lapack_int)
+                                    -> lapack_int;
+}
diff --git a/tests/target/configs/fn_brace_style/always_next_line.rs b/tests/target/configs/fn_brace_style/always_next_line.rs
new file mode 100644 (file)
index 0000000..2755a26
--- /dev/null
@@ -0,0 +1,19 @@
+// rustfmt-brace_style: AlwaysNextLine
+// Function brace style
+
+fn lorem()
+{
+    // body
+}
+
+fn lorem(ipsum: usize)
+{
+    // body
+}
+
+fn lorem<T>(ipsum: T)
+where
+    T: Add + Sub + Mul + Div,
+{
+    // body
+}
diff --git a/tests/target/configs/fn_brace_style/prefer_same_line.rs b/tests/target/configs/fn_brace_style/prefer_same_line.rs
new file mode 100644 (file)
index 0000000..23f98b6
--- /dev/null
@@ -0,0 +1,16 @@
+// rustfmt-brace_style: PreferSameLine
+// Function brace style
+
+fn lorem() {
+    // body
+}
+
+fn lorem(ipsum: usize) {
+    // body
+}
+
+fn lorem<T>(ipsum: T)
+where
+    T: Add + Sub + Mul + Div, {
+    // body
+}
diff --git a/tests/target/configs/fn_brace_style/same_line_where.rs b/tests/target/configs/fn_brace_style/same_line_where.rs
new file mode 100644 (file)
index 0000000..2afe599
--- /dev/null
@@ -0,0 +1,17 @@
+// rustfmt-brace_style: SameLineWhere
+// Function brace style
+
+fn lorem() {
+    // body
+}
+
+fn lorem(ipsum: usize) {
+    // body
+}
+
+fn lorem<T>(ipsum: T)
+where
+    T: Add + Sub + Mul + Div,
+{
+    // body
+}
diff --git a/tests/target/configs/fn_call_indent/block.rs b/tests/target/configs/fn_call_indent/block.rs
new file mode 100644 (file)
index 0000000..d352221
--- /dev/null
@@ -0,0 +1,149 @@
+// rustfmt-indent_style: Block
+// Function call style
+
+fn main() {
+    lorem(
+        "lorem",
+        "ipsum",
+        "dolor",
+        "sit",
+        "amet",
+        "consectetur",
+        "adipiscing",
+        "elit",
+    );
+    // #1501
+    let hyper = Arc::new(Client::with_connector(HttpsConnector::new(
+        TlsClient::new(),
+    )));
+
+    // chain
+    let x = yooooooooooooo
+        .fooooooooooooooo
+        .baaaaaaaaaaaaar(hello, world);
+
+    // #1380
+    {
+        {
+            let creds = self.client
+                .client_credentials(&self.config.auth.oauth2.id, &self.config.auth.oauth2.secret)?;
+        }
+    }
+
+    // nesting macro and function call
+    try!(foo(
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+    ));
+    try!(foo(try!(
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
+        xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+    )));
+}
+
+// #1521
+impl Foo {
+    fn map_pixel_to_coords(&self, point: &Vector2i, view: &View) -> Vector2f {
+        unsafe {
+            Vector2f::from_raw(ffi::sfRenderTexture_mapPixelToCoords(
+                self.render_texture,
+                point.raw(),
+                view.raw(),
+            ))
+        }
+    }
+}
+
+fn issue1420() {
+    given(
+        r#"
+        # Getting started
+        ...
+    "#,
+    ).running(waltz)
+}
+
+// #1563
+fn query(conn: &Connection) -> Result<()> {
+    conn.query_row(
+        r#"
+            SELECT title, date
+            FROM posts,
+            WHERE DATE(date) = $1
+        "#,
+        &[],
+        |row| Post {
+            title: row.get(0),
+            date: row.get(1),
+        },
+    )?;
+
+    Ok(())
+}
+
+// #1449
+fn future_rayon_wait_1_thread() {
+    // run with only 1 worker thread; this would deadlock if we couldn't make progress
+    let mut result = None;
+    ThreadPool::new(Configuration::new().num_threads(1))
+        .unwrap()
+        .install(|| {
+            scope(|s| {
+                use std::sync::mpsc::channel;
+                let (tx, rx) = channel();
+                let a = s.spawn_future(lazy(move || Ok::<usize, ()>(rx.recv().unwrap())));
+                //                          ^^^^ FIXME: why is this needed?
+                let b = s.spawn_future(a.map(|v| v + 1));
+                let c = s.spawn_future(b.map(|v| v + 1));
+                s.spawn(move |_| tx.send(20).unwrap());
+                result = Some(c.rayon_wait().unwrap());
+            });
+        });
+    assert_eq!(result, Some(22));
+}
+
+// #1494
+impl Cursor {
+    fn foo() {
+        self.cur_type()
+            .num_template_args()
+            .or_else(|| {
+                let n: c_int = unsafe { clang_Cursor_getNumTemplateArguments(self.x) };
+
+                if n >= 0 {
+                    Some(n as u32)
+                } else {
+                    debug_assert_eq!(n, -1);
+                    None
+                }
+            })
+            .or_else(|| {
+                let canonical = self.canonical();
+                if canonical != *self {
+                    canonical.num_template_args()
+                } else {
+                    None
+                }
+            });
+    }
+}
+
+fn issue1581() {
+    bootstrap.checks.register("PERSISTED_LOCATIONS", move || {
+        if locations2.0.inner_mut.lock().poisoned {
+            Check::new(
+                State::Error,
+                "Persisted location storage is poisoned due to a write failure",
+            )
+        } else {
+            Check::new(State::Healthy, "Persisted location storage is healthy")
+        }
+    });
+}
+
+fn issue1651() {
+    {
+        let type_list: Vec<_> =
+            try_opt!(types.iter().map(|ty| ty.rewrite(context, shape)).collect());
+    }
+}
diff --git a/tests/target/configs/fn_call_indent/block_tab_spaces_2.rs b/tests/target/configs/fn_call_indent/block_tab_spaces_2.rs
new file mode 100644 (file)
index 0000000..5531e61
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-indent_style: Block
+// rustfmt-max_width: 80
+// rustfmt-tab_spaces: 2
+
+// #1427
+fn main() {
+  exceptaions::config(move || {
+    (
+      NmiConfig {},
+      HardFaultConfig {},
+      SysTickConfig { gpio_sbsrr },
+    )
+  });
+}
diff --git a/tests/target/configs/fn_call_indent/block_trailing_comma.rs b/tests/target/configs/fn_call_indent/block_trailing_comma.rs
new file mode 100644 (file)
index 0000000..a7e8590
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-error_on_line_overflow: false
+// rustfmt-indent_style: Block
+
+// rustfmt should not add trailing comma when rewriting macro. See #1528.
+fn a() {
+    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
+    foo(
+        a,
+        oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt(),
+    );
+}
diff --git a/tests/target/configs/fn_call_indent/visual.rs b/tests/target/configs/fn_call_indent/visual.rs
new file mode 100644 (file)
index 0000000..5454c44
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-indent_style: Visual
+// Function call style
+
+fn main() {
+    lorem("lorem",
+          "ipsum",
+          "dolor",
+          "sit",
+          "amet",
+          "consectetur",
+          "adipiscing",
+          "elit");
+}
diff --git a/tests/target/configs/fn_call_indent/visual_trailing_comma.rs b/tests/target/configs/fn_call_indent/visual_trailing_comma.rs
new file mode 100644 (file)
index 0000000..9738d39
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-error_on_line_overflow: false
+// rustfmt-indent_style: Visual
+
+// rustfmt should not add trailing comma when rewriting macro. See #1528.
+fn a() {
+    panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:");
+}
diff --git a/tests/target/configs/fn_single_line/false.rs b/tests/target/configs/fn_single_line/false.rs
new file mode 100644 (file)
index 0000000..3d092f0
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-fn_single_line: false
+// Single-expression function on single line
+
+fn lorem() -> usize {
+    42
+}
+
+fn lorem() -> usize {
+    let ipsum = 42;
+    ipsum
+}
diff --git a/tests/target/configs/fn_single_line/true.rs b/tests/target/configs/fn_single_line/true.rs
new file mode 100644 (file)
index 0000000..10d94e0
--- /dev/null
@@ -0,0 +1,9 @@
+// rustfmt-fn_single_line: true
+// Single-expression function on single line
+
+fn lorem() -> usize { 42 }
+
+fn lorem() -> usize {
+    let ipsum = 42;
+    ipsum
+}
diff --git a/tests/target/configs/force_explicit_abi/false.rs b/tests/target/configs/force_explicit_abi/false.rs
new file mode 100644 (file)
index 0000000..3c48f8e
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-force_explicit_abi: false
+// Force explicit abi
+
+extern {
+    pub static lorem: c_int;
+}
diff --git a/tests/target/configs/force_explicit_abi/true.rs b/tests/target/configs/force_explicit_abi/true.rs
new file mode 100644 (file)
index 0000000..90f5a8c
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-force_explicit_abi: true
+// Force explicit abi
+
+extern "C" {
+    pub static lorem: c_int;
+}
diff --git a/tests/target/configs/force_multiline_block/false.rs b/tests/target/configs/force_multiline_block/false.rs
new file mode 100644 (file)
index 0000000..7cb4cac
--- /dev/null
@@ -0,0 +1,20 @@
+// rustfmt-force_multiline_blocks: false
+// Option forces multiline match arm and closure bodies to be wrapped in a block
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            if ipsum {
+                println!("dolor");
+            }
+        }
+        Lorem::Dolor => println!("amet"),
+    }
+}
+
+fn main() {
+    result.and_then(|maybe_value| match maybe_value {
+        None => Err("oops"),
+        Some(value) => Ok(1),
+    });
+}
diff --git a/tests/target/configs/force_multiline_block/true.rs b/tests/target/configs/force_multiline_block/true.rs
new file mode 100644 (file)
index 0000000..aec50af
--- /dev/null
@@ -0,0 +1,22 @@
+// rustfmt-force_multiline_blocks: true
+// Option forces multiline match arm and closure bodies to be wrapped in a block
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            if ipsum {
+                println!("dolor");
+            }
+        }
+        Lorem::Dolor => println!("amet"),
+    }
+}
+
+fn main() {
+    result.and_then(|maybe_value| {
+        match maybe_value {
+            None => Err("oops"),
+            Some(value) => Ok(1),
+        }
+    });
+}
diff --git a/tests/target/configs/format_strings/false.rs b/tests/target/configs/format_strings/false.rs
new file mode 100644 (file)
index 0000000..ecca0d7
--- /dev/null
@@ -0,0 +1,8 @@
+// rustfmt-format_strings: false
+// rustfmt-max_width: 50
+// rustfmt-error_on_line_overflow: false
+// Force format strings
+
+fn main() {
+    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
+}
diff --git a/tests/target/configs/format_strings/true.rs b/tests/target/configs/format_strings/true.rs
new file mode 100644 (file)
index 0000000..fdd5ab2
--- /dev/null
@@ -0,0 +1,9 @@
+// rustfmt-format_strings: true
+// rustfmt-max_width: 50
+// Force format strings
+
+fn main() {
+    let lorem = "ipsum dolor sit amet \
+                 consectetur adipiscing elit \
+                 lorem ipsum dolor sit";
+}
diff --git a/tests/target/configs/generics_indent/block.rs b/tests/target/configs/generics_indent/block.rs
new file mode 100644 (file)
index 0000000..c4fcaaf
--- /dev/null
@@ -0,0 +1,22 @@
+// rustfmt-indent_style: Block
+// Generics indent
+
+fn lorem<
+    Ipsum: Eq = usize,
+    Dolor: Eq = usize,
+    Sit: Eq = usize,
+    Amet: Eq = usize,
+    Adipiscing: Eq = usize,
+    Consectetur: Eq = usize,
+    Elit: Eq = usize,
+>(
+    ipsum: Ipsum,
+    dolor: Dolor,
+    sit: Sit,
+    amet: Amet,
+    adipiscing: Adipiscing,
+    consectetur: Consectetur,
+    elit: Elit,
+) -> T {
+    // body
+}
diff --git a/tests/target/configs/generics_indent/visual.rs b/tests/target/configs/generics_indent/visual.rs
new file mode 100644 (file)
index 0000000..491075a
--- /dev/null
@@ -0,0 +1,20 @@
+// rustfmt-indent_style: Visual
+// Generics indent
+
+fn lorem<Ipsum: Eq = usize,
+         Dolor: Eq = usize,
+         Sit: Eq = usize,
+         Amet: Eq = usize,
+         Adipiscing: Eq = usize,
+         Consectetur: Eq = usize,
+         Elit: Eq = usize>(
+    ipsum: Ipsum,
+    dolor: Dolor,
+    sit: Sit,
+    amet: Amet,
+    adipiscing: Adipiscing,
+    consectetur: Consectetur,
+    elit: Elit)
+    -> T {
+    // body
+}
diff --git a/tests/target/configs/hard_tabs/false.rs b/tests/target/configs/hard_tabs/false.rs
new file mode 100644 (file)
index 0000000..ccfb53d
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-hard_tabs: false
+// Hard tabs
+
+fn lorem() -> usize {
+    42 // spaces before 42
+}
diff --git a/tests/target/configs/hard_tabs/true.rs b/tests/target/configs/hard_tabs/true.rs
new file mode 100644 (file)
index 0000000..3ed4e4f
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-hard_tabs: true
+// Hard tabs
+
+fn lorem() -> usize {
+       42 // spaces before 42
+}
diff --git a/tests/target/configs/imports_indent/block.rs b/tests/target/configs/imports_indent/block.rs
new file mode 100644 (file)
index 0000000..84c3b26
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-imports_indent: Block
+
+use lists::{
+    definitive_tactic, itemize_list, shape_for_tactic, struct_lit_formatting, struct_lit_shape,
+    struct_lit_tactic, write_list, DefinitiveListTactic, ListFormatting, ListItem, ListTactic,
+    SeparatorTactic,
+};
diff --git a/tests/target/configs/imports_layout/horizontal_vertical.rs b/tests/target/configs/imports_layout/horizontal_vertical.rs
new file mode 100644 (file)
index 0000000..4a63556
--- /dev/null
@@ -0,0 +1,18 @@
+// rustfmt-imports_indent: Block
+// rustfmt-imports_layout: HorizontalVertical
+
+use comment::{contains_comment, recover_comment_removed, rewrite_comment, FindUncommented};
+use lists::{
+    definitive_tactic,
+    itemize_list,
+    shape_for_tactic,
+    struct_lit_formatting,
+    struct_lit_shape,
+    struct_lit_tactic,
+    write_list,
+    DefinitiveListTactic,
+    ListFormatting,
+    ListItem,
+    ListTactic,
+    SeparatorTactic,
+};
diff --git a/tests/target/configs/imports_layout/mixed.rs b/tests/target/configs/imports_layout/mixed.rs
new file mode 100644 (file)
index 0000000..5d3349a
--- /dev/null
@@ -0,0 +1,9 @@
+// rustfmt-imports_indent: Block
+// rustfmt-imports_layout: Mixed
+
+use comment::{contains_comment, recover_comment_removed, rewrite_comment, FindUncommented};
+use lists::{
+    definitive_tactic, itemize_list, shape_for_tactic, struct_lit_formatting, struct_lit_shape,
+    struct_lit_tactic, write_list, DefinitiveListTactic, ListFormatting, ListItem, ListTactic,
+    SeparatorTactic,
+};
diff --git a/tests/target/configs/item_brace_style/always_next_line.rs b/tests/target/configs/item_brace_style/always_next_line.rs
new file mode 100644 (file)
index 0000000..38ed449
--- /dev/null
@@ -0,0 +1,27 @@
+// rustfmt-brace_style: AlwaysNextLine
+// Item brace style
+
+enum Foo {}
+
+struct Bar {}
+
+struct Lorem
+{
+    ipsum: bool,
+}
+
+struct Dolor<T>
+where
+    T: Eq,
+{
+    sit: T,
+}
+
+#[cfg(test)]
+mod tests
+{
+    #[test]
+    fn it_works()
+    {
+    }
+}
diff --git a/tests/target/configs/item_brace_style/prefer_same_line.rs b/tests/target/configs/item_brace_style/prefer_same_line.rs
new file mode 100644 (file)
index 0000000..5143d75
--- /dev/null
@@ -0,0 +1,18 @@
+// rustfmt-brace_style: PreferSameLine
+// Item brace style
+
+struct Lorem {
+    ipsum: bool,
+}
+
+struct Dolor<T>
+where
+    T: Eq, {
+    sit: T,
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {}
+}
diff --git a/tests/target/configs/item_brace_style/same_line_where.rs b/tests/target/configs/item_brace_style/same_line_where.rs
new file mode 100644 (file)
index 0000000..8a3b285
--- /dev/null
@@ -0,0 +1,19 @@
+// rustfmt-brace_style: SameLineWhere
+// Item brace style
+
+struct Lorem {
+    ipsum: bool,
+}
+
+struct Dolor<T>
+where
+    T: Eq,
+{
+    sit: T,
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn it_works() {}
+}
diff --git a/tests/target/configs/match_arm_blocks/false.rs b/tests/target/configs/match_arm_blocks/false.rs
new file mode 100644 (file)
index 0000000..4d53a96
--- /dev/null
@@ -0,0 +1,10 @@
+// rustfmt-match_arm_blocks: false
+// Wrap match-arms
+
+fn main() {
+    match lorem {
+        true =>
+            foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
+        false => println!("{}", sit),
+    }
+}
diff --git a/tests/target/configs/match_arm_blocks/true.rs b/tests/target/configs/match_arm_blocks/true.rs
new file mode 100644 (file)
index 0000000..d75ef03
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_arm_blocks: true
+// Wrap match-arms
+
+fn main() {
+    match lorem {
+        true => {
+            foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
+        }
+        false => println!("{}", sit),
+    }
+}
diff --git a/tests/target/configs/match_block_trailing_comma/false.rs b/tests/target/configs/match_block_trailing_comma/false.rs
new file mode 100644 (file)
index 0000000..70e0295
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_block_trailing_comma: false
+// Match block trailing comma
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            println!("ipsum");
+        }
+        Lorem::Dolor => println!("dolor"),
+    }
+}
diff --git a/tests/target/configs/match_block_trailing_comma/true.rs b/tests/target/configs/match_block_trailing_comma/true.rs
new file mode 100644 (file)
index 0000000..b78b046
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-match_block_trailing_comma: true
+// Match block trailing comma
+
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            println!("ipsum");
+        },
+        Lorem::Dolor => println!("dolor"),
+    }
+}
diff --git a/tests/target/configs/merge_derives/true.rs b/tests/target/configs/merge_derives/true.rs
new file mode 100644 (file)
index 0000000..4d0148b
--- /dev/null
@@ -0,0 +1,40 @@
+// rustfmt-merge_derives: true
+// Merge multiple derives to a single one.
+
+#[bar]
+#[derive(Eq, PartialEq)]
+#[foo]
+#[derive(Debug)]
+#[foobar]
+#[derive(Copy, Clone)]
+pub enum Foo {}
+
+#[derive(Eq, PartialEq, Debug)]
+#[foobar]
+#[derive(Copy, Clone)]
+pub enum Bar {}
+
+#[derive(Eq, PartialEq, Debug, Copy, Clone)]
+pub enum FooBar {}
+
+mod foo {
+    #[bar]
+    #[derive(Eq, PartialEq)]
+    #[foo]
+    #[derive(Debug)]
+    #[foobar]
+    #[derive(Copy, Clone)]
+    pub enum Foo {}
+}
+
+mod bar {
+    #[derive(Eq, PartialEq, Debug)]
+    #[foobar]
+    #[derive(Copy, Clone)]
+    pub enum Bar {}
+}
+
+mod foobar {
+    #[derive(Eq, PartialEq, Debug, Copy, Clone)]
+    pub enum FooBar {}
+}
diff --git a/tests/target/configs/normalize_comments/false.rs b/tests/target/configs/normalize_comments/false.rs
new file mode 100644 (file)
index 0000000..488962e
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_comments: false
+// Normalize comments
+
+// Lorem ipsum:
+fn dolor() -> usize {}
+
+/* sit amet: */
+fn adipiscing() -> usize {}
+
+// #652
+////////////////////////////////////////////////////////////////////////////////
+// Basic slice extension methods
+////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/target/configs/normalize_comments/true.rs b/tests/target/configs/normalize_comments/true.rs
new file mode 100644 (file)
index 0000000..0bdbe08
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-normalize_comments: true
+// Normalize comments
+
+// Lorem ipsum:
+fn dolor() -> usize {}
+
+// sit amet:
+fn adipiscing() -> usize {}
+
+// #652
+////////////////////////////////////////////////////////////////////////////////
+// Basic slice extension methods
+////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/target/configs/reorder_imported_names/false.rs b/tests/target/configs/reorder_imported_names/false.rs
new file mode 100644 (file)
index 0000000..91db89c
--- /dev/null
@@ -0,0 +1,4 @@
+// rustfmt-reorder_imported_names: false
+// Reorder imported names
+
+use super::{lorem, ipsum, dolor, sit};
diff --git a/tests/target/configs/reorder_imported_names/true.rs b/tests/target/configs/reorder_imported_names/true.rs
new file mode 100644 (file)
index 0000000..59f55f4
--- /dev/null
@@ -0,0 +1,4 @@
+// rustfmt-reorder_imported_names: true
+// Reorder imported names
+
+use super::{dolor, ipsum, lorem, sit};
diff --git a/tests/target/configs/reorder_imports/false.rs b/tests/target/configs/reorder_imports/false.rs
new file mode 100644 (file)
index 0000000..4b85684
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-reorder_imports: false
+// Reorder imports
+
+use lorem;
+use ipsum;
+use dolor;
+use sit;
diff --git a/tests/target/configs/reorder_imports/true.rs b/tests/target/configs/reorder_imports/true.rs
new file mode 100644 (file)
index 0000000..e4ff729
--- /dev/null
@@ -0,0 +1,19 @@
+// rustfmt-reorder_imports: true
+// Reorder imports
+
+use dolor;
+use ipsum;
+use lorem;
+use sit;
+
+fn foo() {
+    use A;
+    use B;
+    use C;
+
+    bar();
+
+    use D;
+    use E;
+    use F;
+}
diff --git a/tests/target/configs/reorder_imports_in_group/false.rs b/tests/target/configs/reorder_imports_in_group/false.rs
new file mode 100644 (file)
index 0000000..29460da
--- /dev/null
@@ -0,0 +1,12 @@
+// rustfmt-reorder_imports: true
+// rustfmt-reorder_imports_in_group: false
+// Reorder imports in group
+
+use dolor;
+/// This comment should stay with `use ipsum;`
+use ipsum;
+use lorem;
+use sit;
+use std::io;
+/// This comment should stay with `use std::mem;`
+use std::mem;
diff --git a/tests/target/configs/reorder_imports_in_group/true.rs b/tests/target/configs/reorder_imports_in_group/true.rs
new file mode 100644 (file)
index 0000000..c5e3536
--- /dev/null
@@ -0,0 +1,13 @@
+// rustfmt-reorder_imports: true
+// rustfmt-reorder_imports_in_group: true
+// Reorder imports in group
+
+use std::io;
+/// This comment should stay with `use std::mem;`
+use std::mem;
+
+use dolor;
+/// This comment should stay with `use ipsum;`
+use ipsum;
+use lorem;
+use sit;
diff --git a/tests/target/configs/same_line_attributes/false.rs b/tests/target/configs/same_line_attributes/false.rs
new file mode 100644 (file)
index 0000000..84ac351
--- /dev/null
@@ -0,0 +1,26 @@
+// rustfmt-same_line_attributes: false
+// Option to place attributes on the same line as fields and variants where possible
+
+enum Lorem {
+    #[serde(skip_serializing)]
+    Ipsum,
+    #[serde(skip_serializing)]
+    Dolor,
+    #[serde(skip_serializing)]
+    Amet,
+}
+
+struct Lorem {
+    #[serde(rename = "Ipsum")]
+    ipsum: usize,
+    #[serde(rename = "Dolor")]
+    dolor: usize,
+    #[serde(rename = "Amet")]
+    amet: usize,
+}
+
+// #1943
+pub struct Bzip2 {
+    #[serde(rename = "level")]
+    level: i32,
+}
diff --git a/tests/target/configs/same_line_attributes/true.rs b/tests/target/configs/same_line_attributes/true.rs
new file mode 100644 (file)
index 0000000..c2d48bb
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-same_line_attributes: true
+// Option to place attributes on the same line as fields and variants where possible
+
+enum Lorem {
+    #[serde(skip_serializing)] Ipsum,
+    #[serde(skip_serializing)] Dolor,
+    #[serde(skip_serializing)] Amet,
+}
+
+struct Lorem {
+    #[serde(rename = "Ipsum")] ipsum: usize,
+    #[serde(rename = "Dolor")] dolor: usize,
+    #[serde(rename = "Amet")] amet: usize,
+}
diff --git a/tests/target/configs/space_before_colon/true.rs b/tests/target/configs/space_before_colon/true.rs
new file mode 100644 (file)
index 0000000..e2895b5
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-space_before_colon: true
+// Space before colon
+
+fn lorem<T : Eq>(t : T) {
+    let ipsum : Dolor = sit;
+}
+
+const LOREM : Lorem = Lorem {
+    ipsum : dolor,
+    sit : amet,
+};
diff --git a/tests/target/configs/spaces_around_ranges/false.rs b/tests/target/configs/spaces_around_ranges/false.rs
new file mode 100644 (file)
index 0000000..3d431e4
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-spaces_around_ranges: false
+// Spaces around ranges
+
+fn main() {
+    let lorem = 0..10;
+}
diff --git a/tests/target/configs/spaces_around_ranges/true.rs b/tests/target/configs/spaces_around_ranges/true.rs
new file mode 100644 (file)
index 0000000..2a456a6
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-spaces_around_ranges: true
+// Spaces around ranges
+
+fn main() {
+    let lorem = 0 .. 10;
+}
diff --git a/tests/target/configs/spaces_within_parens_and_brackets/false.rs b/tests/target/configs/spaces_within_parens_and_brackets/false.rs
new file mode 100644 (file)
index 0000000..908373c
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-spaces_within_parens_and_brackets: false
+// Spaces within parens and brackets
+
+fn lorem<T: Eq>(t: T) {
+    let lorem = (ipsum, dolor);
+    let lorem: [usize; 2] = [ipsum, dolor];
+}
diff --git a/tests/target/configs/spaces_within_parens_and_brackets/true.rs b/tests/target/configs/spaces_within_parens_and_brackets/true.rs
new file mode 100644 (file)
index 0000000..7aff713
--- /dev/null
@@ -0,0 +1,145 @@
+// rustfmt-spaces_within_parens_and_brackets: true
+// Spaces within parens and brackets
+
+fn lorem< T: Eq >( t: T ) {
+    let lorem = ( ipsum, dolor );
+    let lorem: [ usize; 2 ] = [ ipsum, dolor ];
+}
+
+enum E {
+    A( u32 ),
+    B( u32, u32 ),
+    C( u32, u32, u32 ),
+    D(),
+}
+
+struct TupleStruct0();
+struct TupleStruct1( u32 );
+struct TupleStruct2( u32, u32 );
+
+fn fooEmpty() {}
+
+fn foo( e: E, _: u32 ) -> ( u32, u32 ) {
+    // Tuples
+    let t1 = ();
+    let t2 = ( 1, );
+    let t3 = ( 1, 2 );
+
+    let ts0 = TupleStruct0();
+    let ts1 = TupleStruct1( 1 );
+    let ts2 = TupleStruct2( 1, 2 );
+
+    // Tuple pattern
+    let ( a, b, c ) = ( 1, 2, 3 );
+
+    // Expressions
+    let x = ( 1 + 2 ) * ( 3 );
+
+    // Function call
+    fooEmpty();
+    foo( 1, 2 );
+
+    // Pattern matching
+    match e {
+        A( _ ) => (),
+        B( _, _ ) => (),
+        C( .. ) => (),
+        D => (),
+    }
+
+    ( 1, 2 )
+}
+
+struct Foo< T > {
+    i: T,
+}
+
+struct Bar< T, E > {
+    i: T,
+    e: E,
+}
+
+struct Foo< 'a > {
+    i: &'a str,
+}
+
+enum E< T > {
+    T( T ),
+}
+
+enum E< T, S > {
+    T( T ),
+    S( S ),
+}
+
+fn foo< T >( a: T ) {
+    foo::< u32 >( 10 );
+}
+
+fn foo< T, E >( a: T, b: E ) {
+    foo::< u32, str >( 10, "bar" );
+}
+
+fn foo< T: Send, E: Send >( a: T, b: E ) {
+    foo::< u32, str >( 10, "bar" );
+
+    let opt: Option< u32 >;
+    let res: Result< u32, String >;
+}
+
+fn foo< 'a >( a: &'a str ) {
+    foo( "foo" );
+}
+
+fn foo< 'a, 'b >( a: &'a str, b: &'b str ) {
+    foo( "foo", "bar" );
+}
+
+impl Foo {
+    fn bar() {
+        < Foo as Foo >::bar();
+    }
+}
+
+trait MyTrait< A, D > {}
+impl< A: Send, D: Send > MyTrait< A, D > for Foo {}
+
+fn foo()
+where
+    for< 'a > u32: 'a,
+{
+}
+
+fn main() {
+    let arr: [ i32; 5 ] = [ 1, 2, 3, 4, 5 ];
+    let arr: [ i32; 500 ] = [ 0; 500 ];
+
+    let v = vec![ 1, 2, 3 ];
+    assert_eq!( arr, [ 1, 2, 3 ] );
+
+    let i = arr[ 0 ];
+
+    let slice = &arr[ 1..2 ];
+
+    let line100_________________________________________________________________________ = [ 1, 2 ];
+    let line101__________________________________________________________________________ =
+        [ 1, 2 ];
+    let line102___________________________________________________________________________ =
+        [ 1, 2 ];
+    let line103____________________________________________________________________________ =
+        [ 1, 2 ];
+    let line104_____________________________________________________________________________ =
+        [ 1, 2 ];
+
+    let line100_____________________________________________________________________ = vec![ 1, 2 ];
+    let line101______________________________________________________________________ =
+        vec![ 1, 2 ];
+    let line102_______________________________________________________________________ =
+        vec![ 1, 2 ];
+    let line103________________________________________________________________________ =
+        vec![ 1, 2 ];
+    let line104_________________________________________________________________________ =
+        vec![ 1, 2 ];
+}
+
+fn f( slice: &[ i32 ] ) {}
diff --git a/tests/target/configs/struct_field_align_threshold/20.rs b/tests/target/configs/struct_field_align_threshold/20.rs
new file mode 100644 (file)
index 0000000..7d8200a
--- /dev/null
@@ -0,0 +1,466 @@
+// rustfmt-struct_field_align_threshold: 20
+// rustfmt-normalize_comments: true
+// rustfmt-wrap_comments: true
+// rustfmt-error_on_line_overflow: false
+
+struct Foo {
+    x:   u32,
+    yy:  u32, // comment
+    zzz: u32,
+}
+
+pub struct Bar {
+    x:   u32,
+    yy:  u32,
+    zzz: u32,
+
+    xxxxxxx: u32,
+}
+
+fn main() {
+    let foo = Foo {
+        x:   0,
+        yy:  1,
+        zzz: 2,
+    };
+
+    let bar = Bar {
+        x:   0,
+        yy:  1,
+        zzz: 2,
+
+        xxxxxxx: 3,
+    };
+}
+
+/// A Doc comment
+#[AnAttribute]
+pub struct Foo {
+    #[rustfmt_skip]
+    f :   SomeType, // Comment beside a field
+    f: SomeType, // Comment beside a field
+    // Comment on a field
+    #[AnAttribute] g: SomeOtherType,
+    /// A doc comment on a field
+    h: AThirdType,
+    pub i: TypeForPublicField,
+}
+
+// #1029
+pub struct Foo {
+    #[doc(hidden)]
+    // This will NOT get deleted!
+    bar: String, // hi
+}
+
+// #1029
+struct X {
+    // `x` is an important number.
+    #[allow(unused)] // TODO: use
+    x: u32,
+}
+
+// #410
+#[allow(missing_docs)]
+pub struct Writebatch<K: Key> {
+    #[allow(dead_code)] // only used for holding the internal pointer
+    writebatch: RawWritebatch,
+    marker: PhantomData<K>,
+}
+
+struct Bar;
+
+struct NewType(Type, OtherType);
+
+struct NewInt<T: Copy>(
+    pub i32,
+    SomeType, // inline comment
+    T,        // sup
+);
+
+struct Qux<
+    'a,
+    N: Clone + 'a,
+    E: Clone + 'a,
+    G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
+    W: Write + Copy,
+>(
+    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
+    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
+    #[AnAttr]
+    // Comment
+    /// Testdoc
+    G,
+    pub W,
+);
+
+struct Tuple(
+    // Comment 1
+    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
+    // Comment 2
+    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
+);
+
+// With a where clause and generics.
+pub struct Foo<'a, Y: Baz>
+where
+    X: Whatever,
+{
+    f: SomeType, // Comment beside a field
+}
+
+struct Baz {
+    a: A, // Comment A
+    b: B, // Comment B
+    c: C, // Comment C
+}
+
+struct Baz {
+    a: A, // Comment A
+
+    b: B, // Comment B
+
+    c: C, // Comment C
+}
+
+struct Baz {
+    a: A,
+
+    b: B,
+    c: C,
+
+    d: D,
+}
+
+struct Baz {
+    // Comment A
+    a: A,
+
+    // Comment B
+    b: B,
+    // Comment C
+    c: C,
+}
+
+// Will this be a one-liner?
+struct Tuple(
+    A, // Comment
+    B,
+);
+
+pub struct State<F: FnMut() -> time::Timespec> {
+    now: F,
+}
+
+pub struct State<F: FnMut() -> ()> {
+    now: F,
+}
+
+pub struct State<F: FnMut()> {
+    now: F,
+}
+
+struct Palette {
+    /// A map of indices in the palette to a count of pixels in approximately
+    /// that color
+    foo: i32,
+}
+
+// Splitting a single line comment into a block previously had a misalignment
+// when the field had attributes
+struct FieldsWithAttributes {
+    // Pre Comment
+    #[rustfmt_skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
+                                      * BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
+    // Another pre comment
+    #[attr1]
+    #[attr2]
+    pub id: usize, /* CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC
+                    * CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC */
+}
+
+struct Deep {
+    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
+        node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>,
+}
+
+struct Foo<T>(T);
+struct Foo<T>(T)
+where
+    T: Copy,
+    T: Eq;
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUUUUUUU,
+    TTTTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUU,
+);
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUUUUUUU,
+    TTTTTTTTTTTTTTTTTTT,
+)
+where
+    T: PartialEq;
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUUUUUUU,
+    TTTTTTTTTTTTTTTTTTTTT,
+)
+where
+    T: PartialEq;
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUUUUUUU,
+    TTTTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUU,
+)
+where
+    T: PartialEq;
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTT,        // Foo
+    UUUUUUUUUUUUUUUUUUUUUUUU, // Bar
+    // Baz
+    TTTTTTTTTTTTTTTTTTT,
+    // Qux (FIXME #572 - doc comment)
+    UUUUUUUUUUUUUUUUUUU,
+);
+
+mod m {
+    struct X<T>
+    where
+        T: Sized,
+    {
+        a: T,
+    }
+}
+
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTTTT,
+    /// Qux
+    UUUUUUUUUUUUUUUUUUU,
+);
+
+struct Issue677 {
+    pub ptr:   *const libc::c_void,
+    pub trace: fn(obj: *const libc::c_void, tracer: *mut JSTracer),
+}
+
+struct Foo {}
+struct Foo {}
+struct Foo {
+    // comment
+}
+struct Foo {
+    // trailing space ->
+}
+struct Foo { /* comment */ }
+struct Foo( /* comment */ );
+
+struct LongStruct {
+    a: A,
+    the_quick_brown_fox_jumps_over_the_lazy_dog:
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
+}
+
+struct Deep {
+    deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
+        node::Handle<IdRef<'id, Node<Key, Value>>, Type, NodeType>,
+}
+
+struct Foo<C = ()>(String);
+
+// #1364
+fn foo() {
+    convex_shape.set_point(0, &Vector2f { x: 400.0, y: 100.0 });
+    convex_shape.set_point(1, &Vector2f { x: 500.0, y: 70.0 });
+    convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
+    convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
+}
+
+fn main() {
+    let x = Bar;
+
+    // Comment
+    let y = Foo { a: x };
+
+    Foo {
+        a: foo(), // comment
+        // comment
+        b: bar(),
+        ..something
+    };
+
+    Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b() };
+
+    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
+        a: f(),
+        b: b(),
+    };
+
+    Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
+        // Comment
+        a: foo(), // Comment
+        // Comment
+        b: bar(), // Comment
+    };
+
+    Foo { a: Bar, b: f() };
+
+    Quux {
+        x: if cond {
+            bar();
+        },
+        y: baz(),
+    };
+
+    A {
+        // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
+        // amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
+        // hendrerit. Donec et mollis dolor.
+        first: item(),
+        // Praesent et diam eget libero egestas mattis sit amet vitae augue.
+        // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
+        second: Item,
+    };
+
+    Some(Data::MethodCallData(MethodCallData {
+        span:    sub_span.unwrap(),
+        scope:   self.enclosing_scope(id),
+        ref_id:  def_id,
+        decl_id: Some(decl_id),
+    }));
+
+    Diagram {
+        //                 o        This graph demonstrates how
+        //                / \       significant whitespace is
+        //               o   o      preserved.
+        //              /|\   \
+        //             o o o   o
+        graph: G,
+    }
+}
+
+fn matcher() {
+    TagTerminatedByteMatcher {
+        matcher: ByteMatcher {
+            pattern: b"<HTML",
+            mask:    b"\xFF\xDF\xDF\xDF\xDF\xFF",
+        },
+    };
+}
+
+fn issue177() {
+    struct Foo<T> {
+        memb: T,
+    }
+    let foo = Foo::<i64> { memb: 10 };
+}
+
+fn issue201() {
+    let s = S { a: 0, ..b };
+}
+
+fn issue201_2() {
+    let s = S { a: S2 { ..c }, ..b };
+}
+
+fn issue278() {
+    let s = S {
+        a: 0,
+        //
+        b: 0,
+    };
+    let s1 = S {
+        a: 0,
+        // foo
+        //
+        // bar
+        b: 0,
+    };
+}
+
+fn struct_exprs() {
+    Foo { a: 1, b: f(2) };
+    Foo {
+        a: 1,
+        b: f(2),
+        ..g(3)
+    };
+    LoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongStruct {
+        ..base
+    };
+    IntrinsicISizesContribution {
+        content_intrinsic_sizes: IntrinsicISizes {
+            minimum_inline_size: 0,
+        },
+    };
+}
+
+fn issue123() {
+    Foo { a: b, c: d, e: f };
+
+    Foo {
+        a: bb,
+        c: dd,
+        e: ff,
+    };
+
+    Foo {
+        a: ddddddddddddddddddddd,
+        b: cccccccccccccccccccccccccccccccccccccc,
+    };
+}
+
+fn issue491() {
+    Foo {
+        guard: None,
+        arm:   0, // Comment
+    };
+
+    Foo {
+        arm: 0, // Comment
+    };
+
+    Foo {
+        a: aaaaaaaaaa,
+        b: bbbbbbbb,
+        c: cccccccccc,
+        d: dddddddddd, // a comment
+        e: eeeeeeeee,
+    };
+}
+
+fn issue698() {
+    Record {
+        ffffffffffffffffffffffffffields: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+    };
+    Record {
+        ffffffffffffffffffffffffffields:
+            aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+    }
+}
+
+fn issue835() {
+    MyStruct {};
+    MyStruct { /* a comment */ };
+    MyStruct {
+        // Another comment
+    };
+    MyStruct {}
+}
+
+fn field_init_shorthand() {
+    MyStruct { x, y, z };
+    MyStruct { x, y, z, ..base };
+    Foo {
+        aaaaaaaaaa,
+        bbbbbbbb,
+        cccccccccc,
+        dddddddddd, // a comment
+        eeeeeeeee,
+    };
+    Record {
+        ffffffffffffffffffffffffffieldsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+    };
+}
diff --git a/tests/target/configs/struct_lit_indent/block.rs b/tests/target/configs/struct_lit_indent/block.rs
new file mode 100644 (file)
index 0000000..656b562
--- /dev/null
@@ -0,0 +1,9 @@
+// rustfmt-indent_style: Block
+// Struct literal-style
+
+fn main() {
+    let lorem = Lorem {
+        ipsum: dolor,
+        sit: amet,
+    };
+}
diff --git a/tests/target/configs/struct_lit_indent/visual.rs b/tests/target/configs/struct_lit_indent/visual.rs
new file mode 100644 (file)
index 0000000..b4effba
--- /dev/null
@@ -0,0 +1,7 @@
+// rustfmt-indent_style: Visual
+// Struct literal-style
+
+fn main() {
+    let lorem = Lorem { ipsum: dolor,
+                        sit: amet, };
+}
diff --git a/tests/target/configs/struct_lit_single_line/false.rs b/tests/target/configs/struct_lit_single_line/false.rs
new file mode 100644 (file)
index 0000000..e2732b5
--- /dev/null
@@ -0,0 +1,9 @@
+// rustfmt-struct_lit_single_line: false
+// Struct literal multiline-style
+
+fn main() {
+    let lorem = Lorem {
+        ipsum: dolor,
+        sit: amet,
+    };
+}
diff --git a/tests/target/configs/tab_spaces/2.rs b/tests/target/configs/tab_spaces/2.rs
new file mode 100644 (file)
index 0000000..8596170
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-tab_spaces: 2
+// rustfmt-max_width: 30
+// rustfmt-indent_style: Block
+// Tab spaces
+
+fn lorem() {
+  let ipsum = dolor();
+  let sit = vec![
+    "amet",
+    "consectetur",
+    "adipiscing",
+    "elit.",
+  ];
+}
diff --git a/tests/target/configs/tab_spaces/4.rs b/tests/target/configs/tab_spaces/4.rs
new file mode 100644 (file)
index 0000000..524a551
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-tab_spaces: 4
+// rustfmt-max_width: 30
+// rustfmt-indent_style: Block
+// Tab spaces
+
+fn lorem() {
+    let ipsum = dolor();
+    let sit = vec![
+        "amet",
+        "consectetur",
+        "adipiscing",
+        "elit.",
+    ];
+}
diff --git a/tests/target/configs/trailing_comma/always.rs b/tests/target/configs/trailing_comma/always.rs
new file mode 100644 (file)
index 0000000..951dc68
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-trailing_comma: Always
+// Trailing comma
+
+fn main() {
+    let Lorem { ipsum, dolor, sit, } = amet;
+    let Lorem {
+        ipsum,
+        dolor,
+        sit,
+        amet,
+        consectetur,
+        adipiscing,
+    } = elit;
+}
diff --git a/tests/target/configs/trailing_comma/never.rs b/tests/target/configs/trailing_comma/never.rs
new file mode 100644 (file)
index 0000000..ae0e50f
--- /dev/null
@@ -0,0 +1,35 @@
+// rustfmt-trailing_comma: Never
+// Trailing comma
+
+fn main() {
+    let Lorem { ipsum, dolor, sit } = amet;
+    let Lorem {
+        ipsum,
+        dolor,
+        sit,
+        amet,
+        consectetur,
+        adipiscing
+    } = elit;
+
+    // #1544
+    if let VrMsg::ClientReply {
+        request_num: reply_req_num,
+        value,
+        ..
+    } = msg
+    {
+        let _ = safe_assert_eq!(reply_req_num, request_num, op);
+        return Ok((request_num, op, value));
+    }
+
+    // #1710
+    pub struct FileInput {
+        input: StringInput,
+        file_name: OsString
+    }
+    match len {
+        Some(len) => Ok(new(self.input, self.pos + len)),
+        None => Err(self)
+    }
+}
diff --git a/tests/target/configs/trailing_comma/vertical.rs b/tests/target/configs/trailing_comma/vertical.rs
new file mode 100644 (file)
index 0000000..7283cde
--- /dev/null
@@ -0,0 +1,14 @@
+// rustfmt-trailing_comma: Vertical
+// Trailing comma
+
+fn main() {
+    let Lorem { ipsum, dolor, sit } = amet;
+    let Lorem {
+        ipsum,
+        dolor,
+        sit,
+        amet,
+        consectetur,
+        adipiscing,
+    } = elit;
+}
diff --git a/tests/target/configs/trailing_semicolon/false.rs b/tests/target/configs/trailing_semicolon/false.rs
new file mode 100644 (file)
index 0000000..9fa746e
--- /dev/null
@@ -0,0 +1,27 @@
+// rustfmt-trailing_semicolon: false
+
+#![feature(loop_break_value)]
+
+fn main() {
+    'a: loop {
+        break 'a
+    }
+
+    let mut done = false;
+    'b: while !done {
+        done = true;
+        continue 'b
+    }
+
+    let x = loop {
+        break 5
+    };
+
+    let x = 'c: loop {
+        break 'c 5
+    };
+}
+
+fn foo() -> usize {
+    return 0
+}
diff --git a/tests/target/configs/trailing_semicolon/true.rs b/tests/target/configs/trailing_semicolon/true.rs
new file mode 100644 (file)
index 0000000..61b6843
--- /dev/null
@@ -0,0 +1,27 @@
+// rustfmt-trailing_semicolon: true
+
+#![feature(loop_break_value)]
+
+fn main() {
+    'a: loop {
+        break 'a;
+    }
+
+    let mut done = false;
+    'b: while !done {
+        done = true;
+        continue 'b;
+    }
+
+    let x = loop {
+        break 5;
+    };
+
+    let x = 'c: loop {
+        break 'c 5;
+    };
+}
+
+fn foo() -> usize {
+    return 0;
+}
diff --git a/tests/target/configs/type_punctuation_density/compressed.rs b/tests/target/configs/type_punctuation_density/compressed.rs
new file mode 100644 (file)
index 0000000..4b3e02e
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-type_punctuation_density: Compressed
+// Type punctuation density
+
+fn lorem<Ipsum: Dolor+Sit=Amet>() {
+    // body
+}
diff --git a/tests/target/configs/type_punctuation_density/wide.rs b/tests/target/configs/type_punctuation_density/wide.rs
new file mode 100644 (file)
index 0000000..8909036
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-type_punctuation_density: Wide
+// Type punctuation density
+
+fn lorem<Ipsum: Dolor + Sit = Amet>() {
+    // body
+}
diff --git a/tests/target/configs/use_try_shorthand/false.rs b/tests/target/configs/use_try_shorthand/false.rs
new file mode 100644 (file)
index 0000000..de7f8b4
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-use_try_shorthand: false
+// Use try! shorthand
+
+fn main() {
+    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
+}
diff --git a/tests/target/configs/use_try_shorthand/true.rs b/tests/target/configs/use_try_shorthand/true.rs
new file mode 100644 (file)
index 0000000..d3aa035
--- /dev/null
@@ -0,0 +1,6 @@
+// rustfmt-use_try_shorthand: true
+// Use try! shorthand
+
+fn main() {
+    let lorem = ipsum.map(|dolor| dolor.sit())?;
+}
diff --git a/tests/target/configs/where_pred_indent/block.rs b/tests/target/configs/where_pred_indent/block.rs
new file mode 100644 (file)
index 0000000..ad7e0b8
--- /dev/null
@@ -0,0 +1,12 @@
+// rustfmt-indent_style: Block
+// Where predicate indent
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
+where
+    Ipsum: Eq,
+    Dolor: Eq,
+    Sit: Eq,
+    Amet: Eq,
+{
+    // body
+}
diff --git a/tests/target/configs/where_pred_indent/visual.rs b/tests/target/configs/where_pred_indent/visual.rs
new file mode 100644 (file)
index 0000000..45799dc
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-indent_style: Visual
+// Where predicate indent
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
+    where Ipsum: Eq,
+          Dolor: Eq,
+          Sit: Eq,
+          Amet: Eq
+{
+    // body
+}
diff --git a/tests/target/configs/where_single_line/true.rs b/tests/target/configs/where_single_line/true.rs
new file mode 100644 (file)
index 0000000..c4a7f5d
--- /dev/null
@@ -0,0 +1,28 @@
+// rustfmt-where_single_line: true
+// Where style
+
+fn lorem_two_items<Ipsum, Dolor, Sit, Amet>() -> T
+where
+    Ipsum: Eq,
+    Lorem: Eq,
+{
+    // body
+}
+
+fn lorem_multi_line<Ipsum, Dolor, Sit, Amet>(
+    a: Aaaaaaaaaaaaaaa,
+    b: Bbbbbbbbbbbbbbbb,
+    c: Ccccccccccccccccc,
+    d: Ddddddddddddddddddddddddd,
+    e: Eeeeeeeeeeeeeeeeeee,
+) -> T
+where
+    Ipsum: Eq,
+{
+    // body
+}
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
+where Ipsum: Eq {
+    // body
+}
diff --git a/tests/target/configs/where_style/default.rs b/tests/target/configs/where_style/default.rs
new file mode 100644 (file)
index 0000000..a8f0902
--- /dev/null
@@ -0,0 +1,11 @@
+// rustfmt-indent_style: Visual
+// Where style
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
+    where Ipsum: Eq,
+          Dolor: Eq,
+          Sit: Eq,
+          Amet: Eq
+{
+    // body
+}
diff --git a/tests/target/configs/where_style/rfc.rs b/tests/target/configs/where_style/rfc.rs
new file mode 100644 (file)
index 0000000..a7b9a4f
--- /dev/null
@@ -0,0 +1,12 @@
+// rustfmt-indent_style: Block
+// Where style
+
+fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
+where
+    Ipsum: Eq,
+    Dolor: Eq,
+    Sit: Eq,
+    Amet: Eq,
+{
+    // body
+}
diff --git a/tests/target/configs/wrap_comments/false.rs b/tests/target/configs/wrap_comments/false.rs
new file mode 100644 (file)
index 0000000..48ecd88
--- /dev/null
@@ -0,0 +1,8 @@
+// rustfmt-wrap_comments: false
+// rustfmt-max_width: 50
+// rustfmt-error_on_line_overflow: false
+// Wrap comments
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+}
diff --git a/tests/target/configs/wrap_comments/true.rs b/tests/target/configs/wrap_comments/true.rs
new file mode 100644 (file)
index 0000000..4096fd4
--- /dev/null
@@ -0,0 +1,20 @@
+// rustfmt-wrap_comments: true
+// rustfmt-max_width: 50
+// Wrap comments
+
+fn main() {
+    // Lorem ipsum dolor sit amet, consectetur
+    // adipiscing elit, sed do eiusmod tempor
+    // incididunt ut labore et dolore magna
+    // aliqua. Ut enim ad minim veniam, quis
+    // nostrud exercitation ullamco laboris nisi
+    // ut aliquip ex ea commodo consequat.
+}
+
+fn code_block() {
+    // ```rust
+    // let x = 3;
+    //
+    // println!("x = {}", x);
+    // ```
+}