From 2d467c7475f7a0630e112755d05d1ffb919aa7a7 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Tue, 6 Oct 2026 23:46:45 -0400 Subject: [PATCH 1/5] test: stricter test directives Replace `// rustfmt-*` test config comments with `//@ rustfmt-*`. --- Contributing.md | 6 +-- src/test/mod.rs | 6 +-- tests/coverage/source/comments.rs | 2 +- tests/coverage/target/comments.rs | 2 +- tests/parser/try_macro_cant_be_chain_child.rs | 2 +- tests/source/5131_crate.rs | 2 +- tests/source/5131_module.rs | 2 +- tests/source/5131_one.rs | 2 +- tests/source/alignment_2633/block_style.rs | 2 +- tests/source/alignment_2633/visual_style.rs | 4 +- .../arrow_in_single_comment.rs | 2 +- .../arrow_in_comments/multiple_arrows.rs | 2 +- tests/source/async_block.rs | 2 +- tests/source/async_fn.rs | 2 +- tests/source/attrib.rs | 2 +- tests/source/big-impl-visual.rs | 2 +- tests/source/binop-separator-back/bitwise.rs | 2 +- tests/source/binop-separator-back/comp.rs | 2 +- tests/source/binop-separator-back/logic.rs | 2 +- tests/source/binop-separator-back/math.rs | 2 +- tests/source/binop-separator-back/patterns.rs | 2 +- tests/source/binop-separator-back/range.rs | 2 +- tests/source/catch.rs | 2 +- tests/source/cfg_select.rs | 6 +-- tests/source/cfg_select_stable.rs | 2 +- tests/source/chain_yield_with_comments.rs | 2 +- tests/source/chains-visual.rs | 2 +- tests/source/chains.rs | 2 +- tests/source/closure.rs | 2 +- tests/source/comment.rs | 4 +- tests/source/comment2.rs | 2 +- tests/source/comment3.rs | 2 +- tests/source/comment5.rs | 4 +- tests/source/comment6.rs | 2 +- tests/source/comment_crlf_newline.rs | 2 +- .../wrap-comments-not-normalized.rs | 2 +- .../comments-in-lists/wrap-comments-true.rs | 4 +- .../configs/blank_lines_lower_bound/1.rs | 2 +- .../configs/blank_lines_upper_bound/1.rs | 2 +- .../configs/blank_lines_upper_bound/2.rs | 2 +- .../brace_style/fn_always_next_line.rs | 2 +- .../brace_style/fn_prefer_same_line.rs | 2 +- .../configs/brace_style/fn_same_line_where.rs | 2 +- .../brace_style/item_always_next_line.rs | 2 +- .../brace_style/item_prefer_same_line.rs | 2 +- .../brace_style/item_same_line_where.rs | 2 +- tests/source/configs/chain_width/always.rs | 2 +- tests/source/configs/chain_width/small.rs | 2 +- tests/source/configs/chain_width/tiny.rs | 2 +- tests/source/configs/comment_width/above.rs | 4 +- tests/source/configs/comment_width/below.rs | 4 +- tests/source/configs/comment_width/ignore.rs | 4 +- .../condense_wildcard_suffixes/false.rs | 2 +- .../condense_wildcard_suffixes/true.rs | 2 +- .../control_brace_style/always_next_line.rs | 2 +- .../control_brace_style/always_same_line.rs | 2 +- .../control_brace_style/closing_next_line.rs | 2 +- .../configs/disable_all_formatting/false.rs | 2 +- .../configs/disable_all_formatting/true.rs | 2 +- .../default-to-max.rs | 6 +-- .../max-to-default.rs | 6 +-- .../doc_comment_code_block_width/100.rs | 4 +- .../100_greater_max_width.rs | 6 +-- .../doc_comment_code_block_width/50.rs | 4 +- .../configs/empty_item_single_line/false.rs | 2 +- .../configs/empty_item_single_line/true.rs | 2 +- .../enum_discrim_align_threshold/40.rs | 2 +- .../configs/error_on_line_overflow/false.rs | 2 +- .../float_literal_trailing_zero/always.rs | 2 +- .../if-no-postfix.rs | 2 +- .../float_literal_trailing_zero/never.rs | 2 +- .../configs/fn_params_layout/compressed.rs | 2 +- tests/source/configs/fn_params_layout/tall.rs | 2 +- .../configs/fn_params_layout/vertical.rs | 2 +- .../fn_params_layout/vertical_style_2027.rs | 4 +- tests/source/configs/fn_single_line/false.rs | 2 +- tests/source/configs/fn_single_line/true.rs | 2 +- .../configs/force_explicit_abi/false.rs | 2 +- .../source/configs/force_explicit_abi/true.rs | 2 +- .../configs/force_multiline_block/false.rs | 2 +- .../configs/force_multiline_block/true.rs | 2 +- .../configs/format_generated_files/false.rs | 2 +- ...with_generated_marker_line_search_limit.rs | 4 +- .../false_with_marker_out_scope_size.rs | 4 +- .../false_with_zero_search_limit.rs | 4 +- .../configs/format_generated_files/true.rs | 2 +- .../true_with_marker_in_scope_size.rs | 4 +- .../true_with_marker_not_in_header.rs | 2 +- .../configs/format_macro_bodies/false.rs | 2 +- .../configs/format_macro_bodies/true.rs | 2 +- .../configs/format_macro_matchers/false.rs | 2 +- .../configs/format_macro_matchers/true.rs | 2 +- tests/source/configs/format_strings/false.rs | 6 +-- tests/source/configs/format_strings/true.rs | 4 +- .../group_imports/One-merge_imports.rs | 4 +- .../configs/group_imports/One-nested.rs | 2 +- .../configs/group_imports/One-no_reorder.rs | 4 +- tests/source/configs/group_imports/One.rs | 2 +- .../StdExternalCrate-merge_imports.rs | 4 +- .../group_imports/StdExternalCrate-nested.rs | 2 +- .../StdExternalCrate-no_reorder.rs | 4 +- .../StdExternalCrate-non_consecutive.rs | 2 +- .../configs/group_imports/StdExternalCrate.rs | 2 +- tests/source/configs/hard_tabs/false.rs | 2 +- tests/source/configs/hard_tabs/true.rs | 2 +- .../hex_literal_case/hex_literal_lower.rs | 2 +- .../hex_literal_case/hex_literal_preserve.rs | 2 +- .../hex_literal_case/hex_literal_upper.rs | 2 +- .../configs/imports_layout/merge_mixed.rs | 6 +-- .../source/configs/indent_style/block_args.rs | 2 +- .../configs/indent_style/block_array.rs | 2 +- .../source/configs/indent_style/block_call.rs | 2 +- .../configs/indent_style/block_chain.rs | 2 +- .../configs/indent_style/block_generic.rs | 2 +- .../configs/indent_style/block_struct_lit.rs | 2 +- .../block_trailing_comma_call/one.rs | 6 +-- .../block_trailing_comma_call/two.rs | 6 +-- .../configs/indent_style/block_where_pred.rs | 2 +- tests/source/configs/indent_style/default.rs | 2 +- .../source/configs/indent_style/rfc_where.rs | 2 +- .../configs/indent_style/visual_args.rs | 2 +- .../configs/indent_style/visual_array.rs | 2 +- .../configs/indent_style/visual_call.rs | 2 +- .../configs/indent_style/visual_chain.rs | 2 +- .../configs/indent_style/visual_generics.rs | 2 +- .../configs/indent_style/visual_struct_lit.rs | 2 +- .../indent_style/visual_trailing_comma.rs | 4 +- .../configs/indent_style/visual_where_pred.rs | 2 +- .../source/configs/match_arm_blocks/false.rs | 2 +- tests/source/configs/match_arm_blocks/true.rs | 2 +- .../source/configs/match_arm_indent/attrs.rs | 2 +- .../source/configs/match_arm_indent/guards.rs | 2 +- .../configs/match_arm_indent/leading_pipes.rs | 4 +- .../source/configs/match_arm_indent/nested.rs | 2 +- .../configs/match_arm_indent/patterns.rs | 2 +- .../configs/match_arm_indent/unindent.rs | 2 +- .../configs/match_arm_leading_pipes/always.rs | 2 +- .../configs/match_arm_leading_pipes/never.rs | 2 +- .../match_arm_leading_pipes/preserve.rs | 2 +- .../match_block_trailing_comma/false.rs | 2 +- .../match_block_trailing_comma/true.rs | 2 +- tests/source/configs/merge_derives/true.rs | 2 +- .../configs/normalize_comments/false.rs | 2 +- .../source/configs/normalize_comments/true.rs | 2 +- .../configs/normalize_doc_attributes/false.rs | 2 +- .../configs/normalize_doc_attributes/true.rs | 2 +- .../remove_nested_parens.rs | 2 +- .../configs/reorder_impl_items/false.rs | 2 +- .../source/configs/reorder_impl_items/true.rs | 2 +- tests/source/configs/reorder_imports/false.rs | 2 +- tests/source/configs/reorder_imports/true.rs | 2 +- tests/source/configs/reorder_modules/false.rs | 2 +- tests/source/configs/reorder_modules/true.rs | 2 +- .../short_array_element_width_threshold/10.rs | 2 +- .../short_array_element_width_threshold/20.rs | 2 +- .../greater_than_max_width.rs | 4 +- .../single_line_let_else_max_width/100.rs | 2 +- .../single_line_let_else_max_width/50.rs | 2 +- .../single_line_let_else_max_width/zero.rs | 2 +- tests/source/configs/skip_children/true.rs | 2 +- .../source/configs/space_before_colon/true.rs | 2 +- .../configs/spaces_around_ranges/false.rs | 2 +- .../configs/spaces_around_ranges/true.rs | 2 +- .../struct_field_align_threshold/20.rs | 8 ++-- .../configs/struct_lit_single_line/false.rs | 2 +- .../style_edition/overflow_delim_expr_2015.rs | 2 +- .../style_edition/overflow_delim_expr_2024.rs | 2 +- tests/source/configs/tab_spaces/2.rs | 6 +-- tests/source/configs/tab_spaces/4.rs | 6 +-- tests/source/configs/trailing_comma/always.rs | 2 +- tests/source/configs/trailing_comma/never.rs | 2 +- .../source/configs/trailing_comma/vertical.rs | 2 +- .../type_punctuation_density/compressed.rs | 2 +- .../configs/type_punctuation_density/wide.rs | 2 +- .../configs/use_field_init_shorthand/false.rs | 2 +- .../configs/use_field_init_shorthand/true.rs | 2 +- .../configs/use_small_heuristics/default.rs | 2 +- .../configs/use_small_heuristics/max.rs | 2 +- .../configs/use_small_heuristics/off.rs | 2 +- .../source/configs/use_try_shorthand/false.rs | 2 +- .../source/configs/use_try_shorthand/true.rs | 2 +- .../source/configs/where_single_line/true.rs | 2 +- tests/source/configs/wrap_comments/false.rs | 6 +-- tests/source/configs/wrap_comments/true.rs | 4 +- .../control-brace-style-always-next-line.rs | 2 +- .../crash-on-enum-generics/issue_6318.rs | 2 +- tests/source/doc-attrib.rs | 4 +- tests/source/doc-comment-with-example.rs | 2 +- tests/source/doc.rs | 2 +- .../else-if-brace-style-always-next-line.rs | 2 +- .../else-if-brace-style-closing-next-line.rs | 2 +- tests/source/empty-item-single-line-false.rs | 4 +- tests/source/enum.rs | 2 +- tests/source/ergonomic_clones.rs | 2 +- tests/source/expr-overflow-delimited.rs | 2 +- tests/source/expr.rs | 4 +- tests/source/extern.rs | 2 +- tests/source/extern_not_explicit.rs | 2 +- tests/source/file-lines-1.rs | 2 +- tests/source/file-lines-2.rs | 2 +- tests/source/file-lines-3.rs | 2 +- tests/source/file-lines-4.rs | 2 +- tests/source/file-lines-5.rs | 2 +- tests/source/file-lines-6.rs | 2 +- tests/source/file-lines-7.rs | 2 +- tests/source/file-lines-item.rs | 2 +- tests/source/fn-custom-6.rs | 2 +- tests/source/fn-custom-7.rs | 6 +-- tests/source/fn-custom-8.rs | 2 +- tests/source/fn-custom.rs | 2 +- tests/source/fn-simple.rs | 2 +- tests/source/fn-single-line/version_one.rs | 4 +- tests/source/fn-single-line/version_two.rs | 4 +- tests/source/fn_args_indent-block.rs | 2 +- tests/source/fn_args_layout-vertical.rs | 2 +- tests/source/hard-tabs.rs | 6 +-- tests/source/hello.rs | 4 +- tests/source/hello2.rs | 4 +- tests/source/impls.rs | 2 +- tests/source/imports/imports-reorder.rs | 2 +- tests/source/imports/imports.rs | 2 +- .../imports/imports_granularity_crate.rs | 2 +- ...m-with-dups-StdExternalCrate-no-reorder.rs | 6 +-- .../imports_granularity_item-with-dups.rs | 2 +- .../imports/imports_granularity_item.rs | 2 +- .../imports/imports_granularity_module.rs | 2 +- .../source/imports/imports_granularity_one.rs | 2 +- .../imports_raw_identifiers/version_One.rs | 2 +- .../imports_raw_identifiers/version_Two.rs | 2 +- .../invalid-rust-code-in-doc-comment.rs | 2 +- tests/source/issue-1021.rs | 2 +- tests/source/issue-1120.rs | 2 +- tests/source/issue-1124.rs | 2 +- tests/source/issue-1127.rs | 6 +-- tests/source/issue-1177.rs | 2 +- tests/source/issue-1210/a.rs | 4 +- tests/source/issue-1210/b.rs | 4 +- tests/source/issue-1210/c.rs | 4 +- tests/source/issue-1210/d.rs | 2 +- tests/source/issue-1210/e.rs | 4 +- tests/source/issue-1216.rs | 2 +- tests/source/issue-1278.rs | 2 +- tests/source/issue-1350.rs | 4 +- tests/source/issue-1914.rs | 2 +- tests/source/issue-2179/one.rs | 4 +- tests/source/issue-2179/two.rs | 4 +- tests/source/issue-2342.rs | 2 +- tests/source/issue-2482/a.rs | 2 +- tests/source/issue-2496.rs | 2 +- tests/source/issue-2520.rs | 4 +- tests/source/issue-2523.rs | 4 +- tests/source/issue-2644.rs | 2 +- tests/source/issue-2728.rs | 4 +- tests/source/issue-2794.rs | 6 +-- tests/source/issue-2835.rs | 4 +- tests/source/issue-2863.rs | 2 +- tests/source/issue-2869.rs | 2 +- tests/source/issue-2917/packed_simd.rs | 2 +- tests/source/issue-2922.rs | 2 +- tests/source/issue-2927-2.rs | 2 +- tests/source/issue-2927.rs | 2 +- tests/source/issue-2930.rs | 2 +- tests/source/issue-2955.rs | 2 +- tests/source/issue-2985.rs | 2 +- tests/source/issue-3049.rs | 2 +- tests/source/issue-3055/original.rs | 4 +- tests/source/issue-3059.rs | 4 +- tests/source/issue-3066.rs | 2 +- tests/source/issue-3153.rs | 2 +- tests/source/issue-3158.rs | 2 +- tests/source/issue-3213/version_one.rs | 2 +- tests/source/issue-3213/version_two.rs | 2 +- tests/source/issue-3227/two.rs | 2 +- tests/source/issue-3241.rs | 2 +- tests/source/issue-3265.rs | 2 +- tests/source/issue-3270/one.rs | 2 +- tests/source/issue-3270/two.rs | 2 +- tests/source/issue-3272/v1.rs | 2 +- tests/source/issue-3272/v2.rs | 2 +- tests/source/issue-3278/version_one.rs | 2 +- tests/source/issue-3278/version_two.rs | 2 +- tests/source/issue-3295/two.rs | 2 +- tests/source/issue-3302.rs | 2 +- tests/source/issue-3343.rs | 2 +- tests/source/issue-3494/crlf.rs | 2 +- tests/source/issue-3494/lf.rs | 2 +- tests/source/issue-3515.rs | 2 +- tests/source/issue-3585/extern_crate.rs | 2 +- .../issue-3585/reorder_imports_disabled.rs | 4 +- .../issue-3585/reorder_imports_enabled.rs | 4 +- tests/source/issue-3585/use.rs | 2 +- tests/source/issue-3636.rs | 2 +- tests/source/issue-3701/one.rs | 2 +- tests/source/issue-3701/two.rs | 2 +- tests/source/issue-3709.rs | 2 +- tests/source/issue-3750.rs | 2 +- tests/source/issue-3751.rs | 2 +- tests/source/issue-3779/lib.rs | 4 +- tests/source/issue-3787.rs | 2 +- tests/source/issue-3805.rs | 4 +- .../issue-3840/version-one_hard-tabs.rs | 2 +- .../issue-3840/version-two_hard-tabs.rs | 4 +- .../issue-3840/version-two_soft-tabs.rs | 2 +- .../issue-3987/format_macro_bodies_true.rs | 2 +- tests/source/issue-4036/one.rs | 2 +- tests/source/issue-4036/three.rs | 4 +- tests/source/issue-4036/two.rs | 2 +- tests/source/issue-4041.rs | 2 +- tests/source/issue-4079.rs | 2 +- tests/source/issue-4381/style_edition_2015.rs | 2 +- tests/source/issue-447.rs | 2 +- tests/source/issue-4530.rs | 2 +- tests/source/issue-4689/one.rs | 2 +- tests/source/issue-4689/two.rs | 2 +- tests/source/issue-4791/buggy.rs | 4 +- tests/source/issue-4791/trailing_comma.rs | 4 +- .../source/issue-4926/deeply_nested_struct.rs | 2 +- ...ply_nested_struct_with_long_field_names.rs | 2 +- .../deeply_nested_struct_with_many_fields.rs | 2 +- tests/source/issue-4926/enum_struct_field.rs | 6 +-- tests/source/issue-4926/minimum_example.rs | 2 +- .../struct_with_long_field_names.rs | 2 +- .../issue-4926/struct_with_many_fields.rs | 2 +- tests/source/issue-5023.rs | 2 +- tests/source/issue-5030.rs | 4 +- ..._nested_long_comment_wrap_comments_true.rs | 2 +- ..._long_itemized_block_wrap_comments_true.rs | 2 +- .../very_long_comment_wrap_comments_true.rs | 2 +- tests/source/issue-5136-1.rs | 2 +- tests/source/issue-5136-2.rs | 2 +- tests/source/issue-5136-3.rs | 2 +- tests/source/issue-5136-4.rs | 2 +- tests/source/issue-5136-5.rs | 2 +- .../indented_itemized_markdown_blockquote.rs | 2 +- .../nested_itemized_markdown_blockquote.rs | 2 +- .../support_itemized_markdown_blockquote.rs | 2 +- tests/source/issue-5234.rs | 2 +- .../markdown_header_wrap_comments_false.rs | 2 +- .../markdown_header_wrap_comments_true.rs | 2 +- tests/source/issue-5260.rs | 2 +- tests/source/issue-5270/merge_derives_true.rs | 2 +- tests/source/issue-539.rs | 2 +- tests/source/issue-5488.rs | 2 +- tests/source/issue-5586.rs | 2 +- tests/source/issue-5655/one.rs | 2 +- tests/source/issue-5655/two.rs | 2 +- ...ute_unexpectedly_wraps_before_max_width.rs | 2 +- ...ent_unexpectedly_wraps_before_max_width.rs | 8 ++-- tests/source/issue-5835.rs | 2 +- tests/source/issue-5852/horizontal.rs | 2 +- .../source/issue-5852/horizontal_vertical.rs | 2 +- tests/source/issue-5852/split.rs | 2 +- tests/source/issue-5852/vertical.rs | 2 +- tests/source/issue-5987/two.rs | 2 +- tests/source/issue-6147/case_rustfmt_v1.rs | 2 +- tests/source/issue-6147/case_rustfmt_v2.rs | 2 +- tests/source/issue-6202/long_pat.rs | 8 ++-- tests/source/issue-6243.rs | 2 +- tests/source/issue-6333.rs | 4 +- tests/source/issue-6561/trait-fn.rs | 2 +- tests/source/issue-6651/custom_width.rs | 6 +-- tests/source/issue-6651/default.rs | 2 +- tests/source/issue-6795.rs | 2 +- tests/source/issue-6825.rs | 4 +- tests/source/issue-683.rs | 2 +- tests/source/issue-6863/empty-stmt.rs | 2 +- tests/source/issue-6863/fn-stmts.rs | 2 +- tests/source/issue-7054.rs | 2 +- tests/source/issue-977.rs | 2 +- tests/source/issue_1306.rs | 10 ++--- tests/source/issue_4057.rs | 2 +- tests/source/issue_4579.rs | 2 +- tests/source/issue_4584.rs | 2 +- tests/source/issue_5027.rs | 2 +- tests/source/issue_5912.rs | 4 +- tests/source/issue_5920_style_edition_2024.rs | 2 +- tests/source/issue_5920_style_edition_2027.rs | 2 +- tests/source/issue_5982_style_edition_2024.rs | 2 +- tests/source/issue_5982_style_edition_2027.rs | 2 +- tests/source/issue_6121.rs | 2 +- tests/source/issue_6381_style_edition_2027.rs | 2 +- tests/source/issue_6801.rs | 6 +-- tests/source/issue_6831_style_edition_2021.rs | 4 +- tests/source/issue_6831_style_edition_2024.rs | 4 +- tests/source/issue_6831_style_edition_2027.rs | 4 +- tests/source/issue_7003_style_edition_2024.rs | 2 +- tests/source/issue_7003_style_edition_2027.rs | 2 +- tests/source/issue_7055_style_edition_2024.rs | 2 +- tests/source/issue_7055_style_edition_2027.rs | 2 +- tests/source/issue_7088_stable.rs | 2 +- tests/source/issue_7088_unstable.rs | 2 +- .../item-brace-style-always-next-line.rs | 2 +- .../item-brace-style-prefer-same-line.rs | 2 +- tests/source/itemized-blocks/no_wrap.rs | 4 +- tests/source/itemized-blocks/rewrite_fail.rs | 4 +- tests/source/itemized-blocks/urls.rs | 4 +- tests/source/itemized-blocks/wrap.rs | 6 +-- tests/source/lazy_static.rs | 2 +- tests/source/let_chains.rs | 2 +- tests/source/let_else.rs | 2 +- tests/source/let_else_v2.rs | 4 +- tests/source/long-fn-1/version_one.rs | 2 +- tests/source/long-fn-1/version_two.rs | 2 +- tests/source/long-match-arms-brace-newline.rs | 6 +-- tests/source/long-use-statement-issue-3154.rs | 2 +- tests/source/macro_rules.rs | 2 +- tests/source/macros.rs | 4 +- tests/source/markdown-comment-with-options.rs | 2 +- tests/source/match-block-trailing-comma.rs | 2 +- tests/source/match-nowrap-trailing-comma.rs | 4 +- tests/source/match-nowrap.rs | 2 +- tests/source/match.rs | 2 +- tests/source/match_overflow_expr.rs | 2 +- tests/source/max-line-length-in-chars.rs | 2 +- tests/source/merge_imports_true_compat.rs | 2 +- tests/source/mod_skip_child.rs | 2 +- tests/source/multiple.rs | 6 +-- ...on_ascii_numerics_import_asciibetically.rs | 2 +- .../non_ascii_numerics_import_versionsort.rs | 2 +- ...es_should_not_imply_format_doc_comments.rs | 2 +- .../normalize_multiline_doc_attribute.rs | 4 +- tests/source/one_line_if_v1.rs | 2 +- tests/source/one_line_if_v2.rs | 2 +- tests/source/path_clarity/foo.rs | 2 +- tests/source/paths.rs | 2 +- tests/source/pattern-condense-wildcards.rs | 4 +- tests/source/pattern.rs | 2 +- .../preserves_carriage_return_for_unix.rs | 5 ++- .../preserves_carriage_return_for_windows.rs | 5 ++- tests/source/reorder-impl-items.rs | 2 +- .../disabled_style_edition_2024.rs | 4 +- .../disabled_style_edition_2027.rs | 4 +- .../enabled_style_edition_2015.rs | 4 +- .../enabled_style_edition_2024.rs | 4 +- .../enabled_style_edition_2027.rs | 4 +- tests/source/single-line-macro/v1.rs | 2 +- tests/source/single-line-macro/v2.rs | 2 +- tests/source/skip_macro_invocations/all.rs | 2 +- .../skip_macro_invocations/all_and_name.rs | 2 +- .../skip_macro_invocations/config_file.rs | 4 +- tests/source/skip_macro_invocations/empty.rs | 2 +- tests/source/skip_macro_invocations/name.rs | 2 +- .../skip_macro_invocations/name_unknown.rs | 2 +- tests/source/skip_macro_invocations/names.rs | 2 +- .../path_qualified_invocation_mismatch.rs | 2 +- .../path_qualified_match.rs | 2 +- .../path_qualified_name_mismatch.rs | 2 +- .../use_alias_examples.rs | 2 +- tests/source/soft-wrapping.rs | 4 +- tests/source/spaces-around-ranges.rs | 2 +- tests/source/string-lit.rs | 2 +- tests/source/string_lit_unicode_ws.rs | 2 +- tests/source/string_punctuation.rs | 2 +- tests/source/struct_lits.rs | 4 +- tests/source/struct_lits_multiline.rs | 6 +-- tests/source/struct_lits_visual.rs | 6 +-- tests/source/struct_lits_visual_multiline.rs | 8 ++-- tests/source/struct_tuple_visual.rs | 6 +-- tests/source/structs.rs | 4 +- tests/source/trailing-comma-never.rs | 2 +- ...-bodies-edition-2021-style-edition-2027.rs | 4 +- ...-bodies-edition-2024-style-edition-2024.rs | 4 +- .../source/trailing-semicolon/loop-bodies.rs | 4 +- tests/source/trailing_commas.rs | 4 +- tests/source/trailing_comments/hard_tabs.rs | 6 +-- tests/source/trailing_comments/soft_tabs.rs | 4 +- tests/source/try-conversion.rs | 2 +- tests/source/try_block.rs | 2 +- tests/source/try_blocks_heterogeneous.rs | 2 +- tests/source/tuple_v2.rs | 2 +- tests/source/type.rs | 2 +- tests/source/type_alias.rs | 2 +- tests/source/unicode.rs | 2 +- tests/source/unions.rs | 4 +- .../use-identifier-order-mixed-edition.rs | 6 +-- tests/source/use-identifier-order.rs | 6 +-- tests/source/visual-fn-type.rs | 2 +- .../where-clause-comment-wrap-issue-7148.rs | 6 +-- tests/source/where-clause.rs | 2 +- tests/source/width-heuristics.rs | 2 +- ...ts_should_not_imply_format_doc_comments.rs | 2 +- tests/target/5131_crate.rs | 2 +- tests/target/5131_module.rs | 2 +- tests/target/5131_one.rs | 2 +- tests/target/alignment_2633/block_style.rs | 2 +- .../alignment_2633/horizontal_tactic.rs | 2 +- tests/target/alignment_2633/visual_style.rs | 4 +- .../arrow_in_single_comment.rs | 2 +- .../arrow_in_comments/multiple_arrows.rs | 2 +- tests/target/async_block.rs | 2 +- tests/target/async_closure.rs | 2 +- tests/target/async_fn.rs | 2 +- tests/target/asyncness.rs | 2 +- tests/target/attrib.rs | 2 +- tests/target/big-impl-visual.rs | 2 +- tests/target/binop-separator-back/bitwise.rs | 2 +- tests/target/binop-separator-back/comp.rs | 2 +- tests/target/binop-separator-back/logic.rs | 2 +- tests/target/binop-separator-back/math.rs | 2 +- tests/target/binop-separator-back/patterns.rs | 2 +- tests/target/binop-separator-back/range.rs | 2 +- tests/target/catch.rs | 2 +- tests/target/cfg_attribute_in_where.rs | 2 +- tests/target/cfg_select.rs | 6 +-- tests/target/cfg_select_stable.rs | 2 +- tests/target/chain_yield_with_comments.rs | 2 +- tests/target/chains-visual.rs | 2 +- tests/target/chains.rs | 2 +- tests/target/closure.rs | 2 +- tests/target/comment.rs | 4 +- tests/target/comment2.rs | 2 +- tests/target/comment3.rs | 2 +- tests/target/comment5.rs | 4 +- tests/target/comment6.rs | 2 +- tests/target/comment_crlf_newline.rs | 2 +- .../comments-in-lists/format-doc-comments.rs | 2 +- .../comments-in-lists/wrap-comments-false.rs | 2 +- .../wrap-comments-not-normalized.rs | 2 +- .../comments-in-lists/wrap-comments-true.rs | 4 +- .../configs/blank_lines_lower_bound/1.rs | 2 +- .../configs/blank_lines_upper_bound/1.rs | 2 +- .../configs/blank_lines_upper_bound/2.rs | 2 +- .../brace_style/fn_always_next_line.rs | 2 +- .../brace_style/fn_prefer_same_line.rs | 2 +- .../configs/brace_style/fn_same_line_where.rs | 2 +- .../brace_style/item_always_next_line.rs | 2 +- .../brace_style/item_prefer_same_line.rs | 2 +- .../brace_style/item_same_line_where.rs | 2 +- tests/target/configs/chain_width/always.rs | 2 +- tests/target/configs/chain_width/small.rs | 2 +- tests/target/configs/chain_width/tiny.rs | 2 +- .../configs/combine_control_expr/false.rs | 4 +- .../configs/combine_control_expr/true.rs | 4 +- tests/target/configs/comment_width/above.rs | 4 +- tests/target/configs/comment_width/below.rs | 4 +- tests/target/configs/comment_width/ignore.rs | 4 +- .../condense_wildcard_suffixes/false.rs | 2 +- .../condense_wildcard_suffixes/true.rs | 2 +- .../control_brace_style/always_next_line.rs | 2 +- .../control_brace_style/always_same_line.rs | 2 +- .../control_brace_style/closing_next_line.rs | 2 +- .../configs/disable_all_formatting/false.rs | 2 +- .../configs/disable_all_formatting/true.rs | 2 +- .../default-to-max.rs | 6 +-- .../max-to-default.rs | 6 +-- .../doc_comment_code_block_width/100.rs | 4 +- .../100_greater_max_width.rs | 6 +-- .../doc_comment_code_block_width/50.rs | 4 +- .../configs/empty_item_single_line/false.rs | 2 +- .../configs/empty_item_single_line/true.rs | 2 +- .../enum_discrim_align_threshold/40.rs | 2 +- .../configs/error_on_line_overflow/false.rs | 2 +- .../configs/error_on_unformatted/false.rs | 2 +- .../float_literal_trailing_zero/always.rs | 2 +- .../always_spaces_around_ranges_true.rs | 4 +- .../if-no-postfix.rs | 2 +- ...if-no-postfix_spaces_around_ranges_true.rs | 4 +- .../float_literal_trailing_zero/never.rs | 2 +- .../never_spaces_around_ranges_true.rs | 4 +- .../float_literal_trailing_zero/preserve.rs | 2 +- .../preserve_spaces_around_ranges_true.rs | 4 +- .../configs/fn_params_layout/compressed.rs | 2 +- tests/target/configs/fn_params_layout/tall.rs | 2 +- .../configs/fn_params_layout/vertical.rs | 2 +- .../fn_params_layout/vertical_style_2027.rs | 4 +- tests/target/configs/fn_single_line/false.rs | 2 +- tests/target/configs/fn_single_line/true.rs | 2 +- .../configs/force_explicit_abi/false.rs | 2 +- .../target/configs/force_explicit_abi/true.rs | 2 +- .../configs/force_multiline_block/false.rs | 2 +- .../configs/force_multiline_block/true.rs | 2 +- .../configs/format_generated_files/false.rs | 2 +- ...with_generated_marker_line_search_limit.rs | 4 +- .../false_with_marker_out_scope_size.rs | 4 +- .../false_with_zero_search_limit.rs | 4 +- .../configs/format_generated_files/true.rs | 2 +- .../true_with_marker_in_scope_size.rs | 4 +- .../true_with_marker_not_in_header.rs | 2 +- .../configs/format_macro_bodies/false.rs | 2 +- .../configs/format_macro_bodies/true.rs | 2 +- .../configs/format_macro_matchers/false.rs | 2 +- .../configs/format_macro_matchers/true.rs | 2 +- tests/target/configs/format_strings/false.rs | 6 +-- tests/target/configs/format_strings/true.rs | 4 +- .../group_imports/One-merge_imports.rs | 4 +- .../configs/group_imports/One-nested.rs | 2 +- .../configs/group_imports/One-no_reorder.rs | 4 +- tests/target/configs/group_imports/One.rs | 2 +- .../StdExternalCrate-merge_imports.rs | 4 +- .../group_imports/StdExternalCrate-nested.rs | 2 +- .../StdExternalCrate-no_reorder.rs | 4 +- .../StdExternalCrate-non_consecutive.rs | 2 +- .../configs/group_imports/StdExternalCrate.rs | 2 +- tests/target/configs/hard_tabs/false.rs | 2 +- tests/target/configs/hard_tabs/true.rs | 2 +- .../hex_literal_case/hex_literal_lower.rs | 2 +- .../hex_literal_case/hex_literal_preserve.rs | 2 +- .../hex_literal_case/hex_literal_upper.rs | 2 +- tests/target/configs/imports_indent/block.rs | 2 +- .../imports_layout/horizontal_vertical.rs | 4 +- .../configs/imports_layout/merge_mixed.rs | 6 +-- tests/target/configs/imports_layout/mixed.rs | 4 +- .../target/configs/indent_style/block_args.rs | 2 +- .../configs/indent_style/block_array.rs | 2 +- .../target/configs/indent_style/block_call.rs | 2 +- .../configs/indent_style/block_chain.rs | 2 +- .../configs/indent_style/block_generic.rs | 2 +- .../configs/indent_style/block_struct_lit.rs | 2 +- .../indent_style/block_tab_spaces_call.rs | 6 +-- .../block_trailing_comma_call/one.rs | 6 +-- .../block_trailing_comma_call/two.rs | 6 +-- .../configs/indent_style/block_where_pred.rs | 2 +- tests/target/configs/indent_style/default.rs | 2 +- .../configs/indent_style/rfc_control.rs | 2 +- .../target/configs/indent_style/rfc_where.rs | 2 +- .../configs/indent_style/visual_args.rs | 2 +- .../configs/indent_style/visual_array.rs | 2 +- .../configs/indent_style/visual_call.rs | 2 +- .../configs/indent_style/visual_chain.rs | 2 +- .../configs/indent_style/visual_generics.rs | 2 +- .../configs/indent_style/visual_struct_lit.rs | 2 +- .../indent_style/visual_trailing_comma.rs | 4 +- .../configs/indent_style/visual_where_pred.rs | 2 +- .../target/configs/match_arm_blocks/false.rs | 2 +- tests/target/configs/match_arm_blocks/true.rs | 2 +- .../target/configs/match_arm_indent/attrs.rs | 2 +- .../target/configs/match_arm_indent/guards.rs | 2 +- .../configs/match_arm_indent/leading_pipes.rs | 4 +- .../target/configs/match_arm_indent/nested.rs | 2 +- .../configs/match_arm_indent/noindent-tabs.rs | 6 +-- .../configs/match_arm_indent/noindent.rs | 2 +- .../configs/match_arm_indent/patterns.rs | 2 +- .../configs/match_arm_indent/unindent.rs | 2 +- .../configs/match_arm_leading_pipes/always.rs | 2 +- .../configs/match_arm_leading_pipes/never.rs | 2 +- .../match_arm_leading_pipes/preserve.rs | 2 +- .../match_block_trailing_comma/false.rs | 2 +- .../match_block_trailing_comma/true.rs | 2 +- tests/target/configs/merge_derives/true.rs | 2 +- .../configs/normalize_comments/false.rs | 2 +- .../target/configs/normalize_comments/true.rs | 2 +- .../configs/normalize_doc_attributes/false.rs | 2 +- .../configs/normalize_doc_attributes/true.rs | 2 +- .../remove_nested_parens.rs | 2 +- .../configs/reorder_impl_items/false.rs | 2 +- .../target/configs/reorder_impl_items/true.rs | 2 +- tests/target/configs/reorder_imports/false.rs | 2 +- tests/target/configs/reorder_imports/true.rs | 2 +- tests/target/configs/reorder_modules/false.rs | 2 +- tests/target/configs/reorder_modules/true.rs | 2 +- .../short_array_element_width_threshold/10.rs | 2 +- .../short_array_element_width_threshold/20.rs | 2 +- .../greater_than_max_width.rs | 4 +- .../single_line_let_else_max_width/100.rs | 2 +- .../single_line_let_else_max_width/50.rs | 2 +- .../single_line_let_else_max_width/zero.rs | 2 +- tests/target/configs/skip_children/true.rs | 2 +- .../target/configs/space_before_colon/true.rs | 2 +- .../configs/spaces_around_ranges/false.rs | 2 +- .../configs/spaces_around_ranges/true.rs | 2 +- .../struct_field_align_threshold/20.rs | 8 ++-- .../configs/struct_lit_single_line/false.rs | 2 +- .../style_edition/overflow_delim_expr_2015.rs | 2 +- .../style_edition/overflow_delim_expr_2024.rs | 2 +- tests/target/configs/tab_spaces/2.rs | 6 +-- tests/target/configs/tab_spaces/4.rs | 6 +-- tests/target/configs/trailing_comma/always.rs | 2 +- tests/target/configs/trailing_comma/never.rs | 2 +- .../target/configs/trailing_comma/vertical.rs | 2 +- .../configs/trailing_semicolon/false.rs | 2 +- .../target/configs/trailing_semicolon/true.rs | 2 +- .../type_punctuation_density/compressed.rs | 2 +- .../configs/type_punctuation_density/wide.rs | 2 +- .../configs/use_field_init_shorthand/false.rs | 2 +- .../configs/use_field_init_shorthand/true.rs | 2 +- .../configs/use_small_heuristics/default.rs | 2 +- .../configs/use_small_heuristics/max.rs | 2 +- .../configs/use_small_heuristics/off.rs | 2 +- .../target/configs/use_try_shorthand/false.rs | 2 +- .../target/configs/use_try_shorthand/true.rs | 2 +- tests/target/configs/version/mapped.rs | 2 +- .../true-with-brace-style.rs | 4 +- .../target/configs/where_single_line/true.rs | 2 +- tests/target/configs/wrap_comments/false.rs | 6 +-- tests/target/configs/wrap_comments/true.rs | 4 +- .../control-brace-style-always-next-line.rs | 2 +- .../crash-on-enum-generics/issue_6318.rs | 2 +- tests/target/doc-attrib.rs | 4 +- tests/target/doc-comment-with-example.rs | 2 +- tests/target/doc.rs | 2 +- .../else-if-brace-style-always-next-line.rs | 2 +- .../else-if-brace-style-closing-next-line.rs | 2 +- tests/target/empty-item-single-line-false.rs | 4 +- tests/target/enum.rs | 2 +- tests/target/ergonomic_clones.rs | 2 +- tests/target/expr-overflow-delimited.rs | 2 +- tests/target/expr.rs | 4 +- tests/target/extern.rs | 2 +- tests/target/extern_not_explicit.rs | 2 +- tests/target/file-lines-1.rs | 2 +- tests/target/file-lines-2.rs | 2 +- tests/target/file-lines-3.rs | 2 +- tests/target/file-lines-4.rs | 2 +- tests/target/file-lines-5.rs | 2 +- tests/target/file-lines-6.rs | 2 +- tests/target/file-lines-7.rs | 2 +- tests/target/file-lines-item.rs | 2 +- tests/target/fn-custom-6.rs | 2 +- tests/target/fn-custom-7.rs | 6 +-- tests/target/fn-custom-8.rs | 2 +- tests/target/fn-custom.rs | 2 +- tests/target/fn-simple.rs | 2 +- tests/target/fn-single-line/version_one.rs | 4 +- tests/target/fn-single-line/version_two.rs | 4 +- tests/target/fn_args_indent-block.rs | 2 +- tests/target/fn_args_layout-vertical.rs | 2 +- tests/target/format_strings/issue-202.rs | 2 +- tests/target/format_strings/issue-2833.rs | 4 +- tests/target/format_strings/issue-3263.rs | 4 +- tests/target/format_strings/issue-687.rs | 2 +- tests/target/format_strings/issue564.rs | 2 +- tests/target/hard-tabs.rs | 6 +-- tests/target/hello.rs | 4 +- tests/target/impls.rs | 2 +- tests/target/imports/imports-reorder.rs | 2 +- tests/target/imports/imports.rs | 2 +- tests/target/imports/imports_2021_edition.rs | 2 +- .../imports/imports_granularity_crate.rs | 2 +- ...m-with-dups-StdExternalCrate-no-reorder.rs | 6 +-- .../imports_granularity_item-with-dups.rs | 2 +- .../imports/imports_granularity_item.rs | 2 +- .../imports/imports_granularity_module.rs | 2 +- .../target/imports/imports_granularity_one.rs | 2 +- .../imports_raw_identifiers/version_One.rs | 2 +- .../imports_raw_identifiers/version_Two.rs | 2 +- tests/target/indented-impl.rs | 2 +- .../invalid-rust-code-in-doc-comment.rs | 2 +- tests/target/issue-1021.rs | 2 +- tests/target/issue-1120.rs | 2 +- tests/target/issue-1124.rs | 2 +- tests/target/issue-1127.rs | 6 +-- tests/target/issue-1177.rs | 2 +- tests/target/issue-1210/a.rs | 4 +- tests/target/issue-1210/b.rs | 4 +- tests/target/issue-1210/c.rs | 4 +- tests/target/issue-1210/d.rs | 2 +- tests/target/issue-1210/e.rs | 4 +- tests/target/issue-1216.rs | 2 +- tests/target/issue-1247.rs | 2 +- tests/target/issue-1278.rs | 2 +- tests/target/issue-1350.rs | 4 +- tests/target/issue-1681.rs | 2 +- tests/target/issue-1802.rs | 4 +- tests/target/issue-1914.rs | 2 +- tests/target/issue-2123.rs | 2 +- tests/target/issue-2179/one.rs | 4 +- tests/target/issue-2179/two.rs | 4 +- tests/target/issue-2197.rs | 4 +- tests/target/issue-2342.rs | 2 +- tests/target/issue-2346.rs | 2 +- tests/target/issue-2401.rs | 4 +- tests/target/issue-2482/a.rs | 2 +- tests/target/issue-2496.rs | 2 +- tests/target/issue-2520.rs | 4 +- tests/target/issue-2523.rs | 4 +- .../issue-2534/format_macro_matchers_false.rs | 2 +- .../issue-2534/format_macro_matchers_true.rs | 2 +- tests/target/issue-2644.rs | 2 +- tests/target/issue-2673-nonmodrs-mods/foo.rs | 2 +- tests/target/issue-2728.rs | 4 +- tests/target/issue-2759.rs | 4 +- tests/target/issue-2794.rs | 6 +-- tests/target/issue-2810.rs | 2 +- tests/target/issue-2835.rs | 4 +- tests/target/issue-2863.rs | 2 +- tests/target/issue-2869.rs | 2 +- tests/target/issue-2917/packed_simd.rs | 2 +- tests/target/issue-2922.rs | 2 +- tests/target/issue-2927-2.rs | 2 +- tests/target/issue-2927.rs | 2 +- tests/target/issue-2930.rs | 2 +- tests/target/issue-2941.rs | 2 +- tests/target/issue-2955.rs | 2 +- tests/target/issue-2985.rs | 2 +- tests/target/issue-3043.rs | 2 +- tests/target/issue-3049.rs | 2 +- tests/target/issue-3055/backtick.rs | 2 +- tests/target/issue-3055/empty-code-block.rs | 2 +- tests/target/issue-3055/original.rs | 4 +- tests/target/issue-3059.rs | 4 +- tests/target/issue-3066.rs | 2 +- tests/target/issue-3105.rs | 2 +- tests/target/issue-3132.rs | 2 +- tests/target/issue-3153.rs | 2 +- tests/target/issue-3158.rs | 2 +- tests/target/issue-3182.rs | 4 +- tests/target/issue-3213/version_one.rs | 2 +- tests/target/issue-3213/version_two.rs | 2 +- tests/target/issue-3224.rs | 2 +- tests/target/issue-3227/one.rs | 2 +- tests/target/issue-3227/two.rs | 2 +- tests/target/issue-3241.rs | 2 +- tests/target/issue-3265.rs | 2 +- tests/target/issue-3270/one.rs | 2 +- tests/target/issue-3270/two.rs | 2 +- tests/target/issue-3270/wrap.rs | 4 +- tests/target/issue-3272/v1.rs | 2 +- tests/target/issue-3272/v2.rs | 2 +- tests/target/issue-3278/version_one.rs | 2 +- tests/target/issue-3278/version_two.rs | 2 +- tests/target/issue-3295/two.rs | 2 +- tests/target/issue-3302.rs | 2 +- tests/target/issue-3304.rs | 2 +- tests/target/issue-3343.rs | 2 +- tests/target/issue-3442.rs | 2 +- tests/target/issue-3494/crlf.rs | 12 +++--- tests/target/issue-3494/lf.rs | 2 +- tests/target/issue-3515.rs | 2 +- tests/target/issue-3585/extern_crate.rs | 2 +- .../issue-3585/reorder_imports_disabled.rs | 4 +- .../issue-3585/reorder_imports_enabled.rs | 4 +- tests/target/issue-3585/use.rs | 2 +- tests/target/issue-3614/version_one.rs | 2 +- tests/target/issue-3614/version_two.rs | 2 +- tests/target/issue-3636.rs | 2 +- tests/target/issue-3701/one.rs | 2 +- tests/target/issue-3701/two.rs | 2 +- tests/target/issue-3709.rs | 2 +- tests/target/issue-3750.rs | 2 +- tests/target/issue-3751.rs | 2 +- tests/target/issue-3779/lib.rs | 4 +- tests/target/issue-3787.rs | 2 +- tests/target/issue-3805.rs | 4 +- .../issue-3840/version-one_hard-tabs.rs | 2 +- .../issue-3840/version-two_hard-tabs.rs | 4 +- .../issue-3840/version-two_soft-tabs.rs | 2 +- tests/target/issue-3882.rs | 2 +- .../issue-3987/format_macro_bodies_false.rs | 2 +- .../issue-3987/format_macro_bodies_true.rs | 2 +- tests/target/issue-4020.rs | 2 +- tests/target/issue-4036/one.rs | 2 +- tests/target/issue-4036/three.rs | 4 +- tests/target/issue-4036/two.rs | 2 +- tests/target/issue-4041.rs | 2 +- tests/target/issue-4079.rs | 2 +- tests/target/issue-4152.rs | 2 +- tests/target/issue-4210-disabled.rs | 2 +- tests/target/issue-4210.rs | 2 +- tests/target/issue-4381/style_edition_2015.rs | 2 +- tests/target/issue-4381/style_edition_2024.rs | 2 +- tests/target/issue-447.rs | 2 +- tests/target/issue-4530.rs | 2 +- tests/target/issue-4689/one.rs | 2 +- tests/target/issue-4689/two.rs | 2 +- tests/target/issue-4791/buggy.rs | 4 +- tests/target/issue-4791/issue_4928.rs | 38 +++++++++---------- tests/target/issue-4791/no_trailing_comma.rs | 4 +- tests/target/issue-4791/trailing_comma.rs | 4 +- .../target/issue-4926/deeply_nested_struct.rs | 2 +- ...ply_nested_struct_with_long_field_names.rs | 2 +- .../deeply_nested_struct_with_many_fields.rs | 2 +- tests/target/issue-4926/enum_struct_field.rs | 6 +-- tests/target/issue-4926/minimum_example.rs | 2 +- .../struct_with_long_field_names.rs | 2 +- .../issue-4926/struct_with_many_fields.rs | 2 +- .../issue-5012/trailing_comma_always.rs | 2 +- .../target/issue-5012/trailing_comma_never.rs | 2 +- tests/target/issue-5023.rs | 2 +- tests/target/issue-5030.rs | 4 +- ...railing_comma_always_struct_lit_width_0.rs | 6 +-- ...trailing_comma_never_struct_lit_width_0.rs | 6 +-- ..._line_struct_with_trailing_comma_always.rs | 4 +- ...i_line_struct_with_trailing_comma_never.rs | 4 +- .../issue-5066/with_trailing_comma_always.rs | 2 +- .../issue-5066/with_trailing_comma_never.rs | 2 +- ...nested_long_comment_wrap_comments_false.rs | 2 +- ..._nested_long_comment_wrap_comments_true.rs | 2 +- ...line_itemized_block_wrap_comments_false.rs | 2 +- ..._line_itemized_block_wrap_comments_true.rs | 2 +- ...with_itemized_block_wrap_comments_false.rs | 2 +- ..._with_itemized_block_wrap_comments_true.rs | 2 +- ...line_itemized_block_wrap_comments_false.rs | 2 +- ..._line_itemized_block_wrap_comments_true.rs | 2 +- ...long_itemized_block_wrap_comments_false.rs | 2 +- ..._long_itemized_block_wrap_comments_true.rs | 2 +- ..._with_empty_comment_wrap_comments_false.rs | 2 +- ...t_with_empty_comment_wrap_comments_true.rs | 2 +- .../very_long_comment_wrap_comments_false.rs | 2 +- .../very_long_comment_wrap_comments_true.rs | 2 +- tests/target/issue-5095.rs | 2 +- tests/target/issue-5136-1.rs | 2 +- tests/target/issue-5136-2.rs | 2 +- tests/target/issue-5136-3.rs | 2 +- tests/target/issue-5136-4.rs | 2 +- tests/target/issue-5136-5.rs | 2 +- .../indented_itemized_markdown_blockquote.rs | 2 +- .../nested_itemized_markdown_blockquote.rs | 2 +- .../support_itemized_markdown_blockquote.rs | 2 +- tests/target/issue-5234.rs | 2 +- .../markdown_header_wrap_comments_false.rs | 2 +- .../markdown_header_wrap_comments_true.rs | 2 +- tests/target/issue-5244/unwrapped.rs | 2 +- tests/target/issue-5244/wrapped.rs | 2 +- tests/target/issue-5260.rs | 2 +- .../target/issue-5270/merge_derives_false.rs | 2 +- tests/target/issue-5270/merge_derives_true.rs | 2 +- tests/target/issue-539.rs | 2 +- tests/target/issue-5488.rs | 2 +- tests/target/issue-5568.rs | 4 +- tests/target/issue-5586.rs | 2 +- tests/target/issue-5655/one.rs | 2 +- tests/target/issue-5655/two.rs | 2 +- .../issue-5797/retain_trailing_semicolon.rs | 2 +- ...ttribute_does_not_wrap_within_max_width.rs | 2 +- ...ute_unexpectedly_wraps_before_max_width.rs | 2 +- .../comment_does_not_wrap_within_max_width.rs | 8 ++-- ...ent_unexpectedly_wraps_before_max_width.rs | 8 ++-- tests/target/issue-5835.rs | 2 +- tests/target/issue-5852/horizontal.rs | 2 +- .../target/issue-5852/horizontal_vertical.rs | 2 +- tests/target/issue-5852/split.rs | 2 +- tests/target/issue-5852/vertical.rs | 2 +- tests/target/issue-5987/one.rs | 2 +- tests/target/issue-5987/two.rs | 2 +- tests/target/issue-6147/case_rustfmt_v1.rs | 2 +- tests/target/issue-6147/case_rustfmt_v2.rs | 2 +- tests/target/issue-6202/long_pat.rs | 8 ++-- tests/target/issue-6243.rs | 2 +- tests/target/issue-6333-2024.rs | 4 +- tests/target/issue-6333.rs | 4 +- tests/target/issue-6411.rs | 2 +- tests/target/issue-6561/trait-fn.rs | 2 +- tests/target/issue-6651/custom_width.rs | 6 +-- tests/target/issue-6651/default.rs | 2 +- tests/target/issue-6795.rs | 2 +- tests/target/issue-6825.rs | 4 +- tests/target/issue-683.rs | 2 +- tests/target/issue-6863/empty-stmt.rs | 2 +- tests/target/issue-6863/fn-stmts.rs | 2 +- tests/target/issue-691.rs | 2 +- tests/target/issue-7054.rs | 2 +- tests/target/issue-977.rs | 2 +- tests/target/issue_1306.rs | 10 ++--- tests/target/issue_3937.rs | 2 +- tests/target/issue_4049.rs | 10 ++--- tests/target/issue_4057.rs | 2 +- tests/target/issue_4579.rs | 2 +- tests/target/issue_4584.rs | 2 +- tests/target/issue_5027.rs | 2 +- tests/target/issue_5399.rs | 2 +- tests/target/issue_5533.rs | 2 +- tests/target/issue_5907.rs | 2 +- tests/target/issue_5912.rs | 4 +- tests/target/issue_5920_style_edition_2024.rs | 2 +- tests/target/issue_5920_style_edition_2027.rs | 2 +- tests/target/issue_5982_style_edition_2024.rs | 2 +- tests/target/issue_5982_style_edition_2027.rs | 2 +- tests/target/issue_6121.rs | 2 +- tests/target/issue_6381_style_edition_2024.rs | 2 +- tests/target/issue_6381_style_edition_2027.rs | 2 +- tests/target/issue_6801.rs | 6 +-- tests/target/issue_6831_style_edition_2021.rs | 4 +- tests/target/issue_6831_style_edition_2024.rs | 4 +- tests/target/issue_6831_style_edition_2027.rs | 4 +- tests/target/issue_6859_hard_tab_breaks.rs | 2 +- tests/target/issue_6984_style_edition_2024.rs | 2 +- tests/target/issue_6984_style_edition_2027.rs | 2 +- tests/target/issue_7003_style_edition_2024.rs | 2 +- tests/target/issue_7003_style_edition_2027.rs | 2 +- tests/target/issue_7055_style_edition_2024.rs | 2 +- tests/target/issue_7055_style_edition_2027.rs | 2 +- tests/target/issue_7088_stable.rs | 2 +- tests/target/issue_7088_unstable.rs | 2 +- .../item-brace-style-always-next-line.rs | 2 +- .../item-brace-style-prefer-same-line.rs | 2 +- tests/target/itemized-blocks/no_wrap.rs | 4 +- tests/target/itemized-blocks/rewrite_fail.rs | 4 +- tests/target/itemized-blocks/urls.rs | 4 +- tests/target/itemized-blocks/wrap.rs | 6 +-- tests/target/lazy_static.rs | 2 +- tests/target/let_chains.rs | 2 +- tests/target/let_else.rs | 2 +- tests/target/let_else_v2.rs | 4 +- tests/target/long-fn-1/version_one.rs | 2 +- tests/target/long-fn-1/version_two.rs | 2 +- tests/target/long-match-arms-brace-newline.rs | 6 +-- tests/target/long-use-statement-issue-3154.rs | 2 +- tests/target/macro_rules.rs | 2 +- tests/target/macros.rs | 4 +- tests/target/markdown-comment-with-options.rs | 2 +- tests/target/match-block-trailing-comma.rs | 2 +- tests/target/match-nowrap-trailing-comma.rs | 4 +- tests/target/match-nowrap.rs | 2 +- tests/target/match.rs | 2 +- tests/target/match_overflow_expr.rs | 2 +- tests/target/max-line-length-in-chars.rs | 2 +- tests/target/merge_imports_true_compat.rs | 2 +- tests/target/mod_skip_child.rs | 2 +- tests/target/multiple.rs | 6 +-- ...on_ascii_numerics_import_asciibetically.rs | 2 +- .../non_ascii_numerics_import_versionsort.rs | 2 +- ...es_should_not_imply_format_doc_comments.rs | 2 +- .../normalize_multiline_doc_attribute.rs | 4 +- tests/target/one_line_if_v1.rs | 2 +- tests/target/one_line_if_v2.rs | 2 +- tests/target/path_clarity/foo.rs | 2 +- tests/target/paths.rs | 2 +- tests/target/pattern-condense-wildcards.rs | 4 +- tests/target/pattern.rs | 2 +- .../preserves_carriage_return_for_unix.rs | 5 ++- .../preserves_carriage_return_for_windows.rs | 5 ++- tests/target/raw-lifetimes.rs | 2 +- tests/target/reorder-impl-items.rs | 2 +- .../disabled_style_edition_2024.rs | 4 +- .../disabled_style_edition_2027.rs | 4 +- .../enabled_style_edition_2015.rs | 4 +- .../enabled_style_edition_2024.rs | 4 +- .../enabled_style_edition_2027.rs | 4 +- tests/target/single-line-macro/v1.rs | 2 +- tests/target/single-line-macro/v2.rs | 2 +- tests/target/skip_macro_invocations/all.rs | 2 +- .../skip_macro_invocations/all_and_name.rs | 2 +- .../skip_macro_invocations/config_file.rs | 4 +- tests/target/skip_macro_invocations/empty.rs | 2 +- tests/target/skip_macro_invocations/name.rs | 2 +- .../skip_macro_invocations/name_unknown.rs | 2 +- tests/target/skip_macro_invocations/names.rs | 2 +- .../path_qualified_invocation_mismatch.rs | 2 +- .../path_qualified_match.rs | 2 +- .../path_qualified_name_mismatch.rs | 2 +- .../use_alias_examples.rs | 2 +- tests/target/soft-wrapping.rs | 4 +- tests/target/spaces-around-ranges.rs | 2 +- tests/target/string-lit.rs | 2 +- tests/target/string_lit_unicode_ws.rs | 2 +- tests/target/string_punctuation.rs | 2 +- tests/target/struct_lits.rs | 4 +- tests/target/struct_lits_multiline.rs | 6 +-- tests/target/struct_lits_visual.rs | 6 +-- tests/target/struct_lits_visual_multiline.rs | 8 ++-- tests/target/struct_tuple_visual.rs | 6 +-- tests/target/structs.rs | 4 +- tests/target/style_edition/follows_edition.rs | 2 +- .../overrides_edition_when_set.rs | 4 +- tests/target/trailing-comma-never.rs | 2 +- ...-bodies-edition-2021-style-edition-2027.rs | 4 +- ...-bodies-edition-2024-style-edition-2024.rs | 4 +- .../target/trailing-semicolon/loop-bodies.rs | 4 +- tests/target/trailing_commas.rs | 4 +- tests/target/trailing_comments/hard_tabs.rs | 6 +-- tests/target/trailing_comments/soft_tabs.rs | 4 +- tests/target/try-conversion.rs | 2 +- tests/target/try_block.rs | 2 +- tests/target/try_blocks_heterogeneous.rs | 2 +- tests/target/tuple_v2.rs | 2 +- tests/target/type.rs | 2 +- tests/target/type_alias.rs | 2 +- tests/target/unicode.rs | 2 +- tests/target/unions.rs | 4 +- .../use-identifier-order-mixed-edition.rs | 6 +-- tests/target/use-identifier-order.rs | 6 +-- tests/target/visual-fn-type.rs | 2 +- .../where-clause-comment-wrap-issue-7148.rs | 6 +-- tests/target/where-clause.rs | 2 +- tests/target/width-heuristics.rs | 2 +- ...ts_should_not_imply_format_doc_comments.rs | 2 +- tests/warning/source/issue_3950.rs | 2 +- tests/warning/source/issue_4968.rs | 4 +- tests/warning/source/issue_6442.rs | 2 +- tests/warning/source/issue_6850.rs | 2 +- tests/warning/source/line_overflow_tabs.rs | 2 +- .../line_overflow_with_trailing_whitespace.rs | 2 +- .../source/trailing_whitespace_overflow.rs | 2 +- tests/writemode/source/fn-single-line.rs | 4 +- tests/writemode/source/json.rs | 4 +- tests/writemode/source/modified.rs | 2 +- 1076 files changed, 1461 insertions(+), 1457 deletions(-) diff --git a/Contributing.md b/Contributing.md index f388d7cb882..9e37f15e62b 100644 --- a/Contributing.md +++ b/Contributing.md @@ -77,13 +77,13 @@ Without explicit settings, the tests will be run using rustfmt's default configuration. It is possible to run a test using non-default settings in several ways. Firstly, you can include configuration parameters in comments at the top of the file. For example: to use 3 spaces per tab, start your test with -`// rustfmt-tab_spaces: 3`. Just remember that the comment is part of the input, +`//@ rustfmt-tab_spaces: 3`. Just remember that the comment is part of the input, so include in both the source and target files! It is also possible to explicitly specify the name of the expected output file in the target directory. -Use `// rustfmt-target: filename.rs` for this. You can also specify a custom +Use `//@ rustfmt-target: filename.rs` for this. You can also specify a custom configuration by using the `rustfmt-config` directive. Rustfmt will then use that toml file located in `./tests/config/` for its configuration. Including -`// rustfmt-config: small_tabs.toml` will run your test with the configuration +`//@ rustfmt-config: small_tabs.toml` will run your test with the configuration file found at `./tests/config/small_tabs.toml`. The final option is used when the test source file contains no configuration parameter comments. In this case, the test harness looks for a configuration file with the same filename as the test diff --git a/src/test/mod.rs b/src/test/mod.rs index c1007511126..5f7f4ca7c73 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -127,7 +127,7 @@ fn verify_config_used(path: &Path, config_name: &str) { let entry = entry.expect("couldn't get directory entry"); let path = entry.path(); if path.extension().map_or(false, |f| f == "rs") { - // check if "// rustfmt-:" appears in the file. + // check if "//@ rustfmt-:" appears in the file. let filebuf = BufReader::new( fs::File::open(&path) .unwrap_or_else(|_| panic!("couldn't read file {}", path.display())), @@ -137,7 +137,7 @@ fn verify_config_used(path: &Path, config_name: &str) { .lines() .map(Result::unwrap) .take_while(|l| l.starts_with("//")) - .any(|l| l.starts_with(&format!("// rustfmt-{}", config_name))), + .any(|l| l.starts_with(&format!("//@ rustfmt-{}", config_name))), "config option file {} does not contain expected config name", path.display() ); @@ -985,7 +985,7 @@ fn get_config( .expect("invalid TOML") } -// Reads significant comments of the form: `// rustfmt-key: value` into a hash map. +// Reads significant comments of the form: `//@ rustfmt-key: value` into a hash map. fn read_significant_comments(file_name: &Path) -> HashMap { let file = fs::File::open(file_name) .unwrap_or_else(|_| panic!("couldn't read file {}", file_name.display())); diff --git a/tests/coverage/source/comments.rs b/tests/coverage/source/comments.rs index 10940039e8e..0766892587c 100644 --- a/tests/coverage/source/comments.rs +++ b/tests/coverage/source/comments.rs @@ -1,4 +1,4 @@ -// rustfmt-emit_mode: coverage +//@ rustfmt-emit_mode: coverage /// Here's a doc comment! fn main() { // foo is bar diff --git a/tests/coverage/target/comments.rs b/tests/coverage/target/comments.rs index 95e7b4705e3..6cc74e464b4 100644 --- a/tests/coverage/target/comments.rs +++ b/tests/coverage/target/comments.rs @@ -1,4 +1,4 @@ -XX XXXXXXXXXXXXXXXXXX XXXXXXXX +XXX XXXXXXXXXXXXXXXXXX XXXXXXXX /// Here's a doc comment! fn main() { XX XXX XX XXX diff --git a/tests/parser/try_macro_cant_be_chain_child.rs b/tests/parser/try_macro_cant_be_chain_child.rs index 98beb566f82..d245254ad06 100644 --- a/tests/parser/try_macro_cant_be_chain_child.rs +++ b/tests/parser/try_macro_cant_be_chain_child.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2015 +//@ rustfmt-edition: 2015 // set edition for clarity, since 'try' became a reserved keyword in editions >=2018 fn main() { diff --git a/tests/source/5131_crate.rs b/tests/source/5131_crate.rs index 96a31659022..3e1ed0172e9 100644 --- a/tests/source/5131_crate.rs +++ b/tests/source/5131_crate.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Crate +//@ rustfmt-imports_granularity: Crate use foo::a; use foo::a; diff --git a/tests/source/5131_module.rs b/tests/source/5131_module.rs index 3e9139177c5..2765baf86b1 100644 --- a/tests/source/5131_module.rs +++ b/tests/source/5131_module.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Module +//@ rustfmt-imports_granularity: Module #![allow(dead_code)] diff --git a/tests/source/5131_one.rs b/tests/source/5131_one.rs index 61ddf13410d..f3338227f0a 100644 --- a/tests/source/5131_one.rs +++ b/tests/source/5131_one.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: One +//@ rustfmt-imports_granularity: One pub use foo::x; pub use foo::x as x2; diff --git a/tests/source/alignment_2633/block_style.rs b/tests/source/alignment_2633/block_style.rs index 77fb2919edb..3447491a49b 100644 --- a/tests/source/alignment_2633/block_style.rs +++ b/tests/source/alignment_2633/block_style.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 50 +//@ rustfmt-struct_field_align_threshold: 50 fn func() { Ok(ServerInformation { name: unwrap_message_string(items.get(0)), diff --git a/tests/source/alignment_2633/visual_style.rs b/tests/source/alignment_2633/visual_style.rs index f34cc621e64..b667e9c31dc 100644 --- a/tests/source/alignment_2633/visual_style.rs +++ b/tests/source/alignment_2633/visual_style.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 50 -// rustfmt-indent_style: Visual +//@ rustfmt-struct_field_align_threshold: 50 +//@ rustfmt-indent_style: Visual fn func() { Ok(ServerInformation { name: unwrap_message_string(items.get(0)), diff --git a/tests/source/arrow_in_comments/arrow_in_single_comment.rs b/tests/source/arrow_in_comments/arrow_in_single_comment.rs index 38e8967e7e6..066a449eb8a 100644 --- a/tests/source/arrow_in_comments/arrow_in_single_comment.rs +++ b/tests/source/arrow_in_comments/arrow_in_single_comment.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { match a { _ => diff --git a/tests/source/arrow_in_comments/multiple_arrows.rs b/tests/source/arrow_in_comments/multiple_arrows.rs index 98ef919450f..3696f8c7d67 100644 --- a/tests/source/arrow_in_comments/multiple_arrows.rs +++ b/tests/source/arrow_in_comments/multiple_arrows.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { match a { _ => // comment with => diff --git a/tests/source/async_block.rs b/tests/source/async_block.rs index 18cb4fb5f5c..dcfe2911302 100644 --- a/tests/source/async_block.rs +++ b/tests/source/async_block.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 fn main() { let x = async { diff --git a/tests/source/async_fn.rs b/tests/source/async_fn.rs index c63cf5b0f51..a76fcfd7079 100644 --- a/tests/source/async_fn.rs +++ b/tests/source/async_fn.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 async fn bar() -> Result<(), ()> { Ok(()) diff --git a/tests/source/attrib.rs b/tests/source/attrib.rs index d45fba55224..0b8e383c0d0 100644 --- a/tests/source/attrib.rs +++ b/tests/source/attrib.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Test attributes and doc comments are preserved. #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico", diff --git a/tests/source/big-impl-visual.rs b/tests/source/big-impl-visual.rs index 7d906ac37f9..a244554340a 100644 --- a/tests/source/big-impl-visual.rs +++ b/tests/source/big-impl-visual.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // #1357 impl< diff --git a/tests/source/binop-separator-back/bitwise.rs b/tests/source/binop-separator-back/bitwise.rs index 3804bf3215b..c8c8fa17d91 100644 --- a/tests/source/binop-separator-back/bitwise.rs +++ b/tests/source/binop-separator-back/bitwise.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ^ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; diff --git a/tests/source/binop-separator-back/comp.rs b/tests/source/binop-separator-back/comp.rs index 50a27127445..7da132e4b61 100644 --- a/tests/source/binop-separator-back/comp.rs +++ b/tests/source/binop-separator-back/comp.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ < abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ { diff --git a/tests/source/binop-separator-back/logic.rs b/tests/source/binop-separator-back/logic.rs index 8c297e5a675..2ae920d4286 100644 --- a/tests/source/binop-separator-back/logic.rs +++ b/tests/source/binop-separator-back/logic.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ && abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ || abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ { diff --git a/tests/source/binop-separator-back/math.rs b/tests/source/binop-separator-back/math.rs index 3af4aad1605..3c31a14ab19 100644 --- a/tests/source/binop-separator-back/math.rs +++ b/tests/source/binop-separator-back/math.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; diff --git a/tests/source/binop-separator-back/patterns.rs b/tests/source/binop-separator-back/patterns.rs index a8c3b5cdd9b..3489beedb3b 100644 --- a/tests/source/binop-separator-back/patterns.rs +++ b/tests/source/binop-separator-back/patterns.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { match val { diff --git a/tests/source/binop-separator-back/range.rs b/tests/source/binop-separator-back/range.rs index bdd3de9922b..14956c320ee 100644 --- a/tests/source/binop-separator-back/range.rs +++ b/tests/source/binop-separator-back/range.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ..abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; diff --git a/tests/source/catch.rs b/tests/source/catch.rs index 541db1dc90c..37f52745e5c 100644 --- a/tests/source/catch.rs +++ b/tests/source/catch.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(try_blocks)] fn main() { diff --git a/tests/source/cfg_select.rs b/tests/source/cfg_select.rs index 26f276edeef..ca6abc8aa4a 100644 --- a/tests/source/cfg_select.rs +++ b/tests/source/cfg_select.rs @@ -1,6 +1,6 @@ -// rustfmt-unstable: true -// rustfmt-style_edition: 2024 -// rustfmt-skip_children: true +//@ rustfmt-unstable: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-skip_children: true // empty cfg_select! // Original `{}` delimiters diff --git a/tests/source/cfg_select_stable.rs b/tests/source/cfg_select_stable.rs index 7f37a155cfc..875ad3b53f2 100644 --- a/tests/source/cfg_select_stable.rs +++ b/tests/source/cfg_select_stable.rs @@ -1,4 +1,4 @@ -// rustfmt-stable: true +//@ rustfmt-stable: true // While we gate the `cfg_select!` formatting behind the `is_nightly_channel!()` check // this test helps ensure that we don't start formatting `cfg_select!` on the `stable` diff --git a/tests/source/chain_yield_with_comments.rs b/tests/source/chain_yield_with_comments.rs index 41e1db18edb..59fd40014a5 100644 --- a/tests/source/chain_yield_with_comments.rs +++ b/tests/source/chain_yield_with_comments.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2024 +//@ rustfmt-edition: 2024 fn f() { parent /* comment */ .yield /* some comment */?// comment diff --git a/tests/source/chains-visual.rs b/tests/source/chains-visual.rs index 20a96311e34..878f70f3904 100644 --- a/tests/source/chains-visual.rs +++ b/tests/source/chains-visual.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Test chain formatting. fn main() { diff --git a/tests/source/chains.rs b/tests/source/chains.rs index c77f5bac4cb..7aaffa31f07 100644 --- a/tests/source/chains.rs +++ b/tests/source/chains.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Off +//@ rustfmt-use_small_heuristics: Off // Test chain formatting. fn main() { diff --git a/tests/source/closure.rs b/tests/source/closure.rs index b2d28b305d0..87cdad46aea 100644 --- a/tests/source/closure.rs +++ b/tests/source/closure.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Closures fn main() { diff --git a/tests/source/comment.rs b/tests/source/comment.rs index b6ce5267fcb..c2b530bd8d0 100644 --- a/tests/source/comment.rs +++ b/tests/source/comment.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true //! Doc comment fn test() { diff --git a/tests/source/comment2.rs b/tests/source/comment2.rs index d68bb5483dc..0807bf8f2db 100644 --- a/tests/source/comment2.rs +++ b/tests/source/comment2.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// This is a long line that angers rustfmt. Rustfmt shall deal with it swiftly and justly. pub mod foo {} diff --git a/tests/source/comment3.rs b/tests/source/comment3.rs index f19a8586334..4f78efaf4e1 100644 --- a/tests/source/comment3.rs +++ b/tests/source/comment3.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! This is a long line that angers rustfmt. Rustfmt shall deal with it swiftly and justly. diff --git a/tests/source/comment5.rs b/tests/source/comment5.rs index 2835d8b2578..754e36510e6 100644 --- a/tests/source/comment5.rs +++ b/tests/source/comment5.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true //@ special comment //@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam diff --git a/tests/source/comment6.rs b/tests/source/comment6.rs index e5d72113ce6..f786ed5ca70 100644 --- a/tests/source/comment6.rs +++ b/tests/source/comment6.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Pendant la nuit du 9 mars 1860, les nuages, se confondant avec la mer, limitaient à quelques brasses la portée de la vue. // Sur cette mer démontée, dont les lames déferlaient en projetant des lueurs livides, un léger bâtiment fuyait presque à sec de toile. diff --git a/tests/source/comment_crlf_newline.rs b/tests/source/comment_crlf_newline.rs index 7a65f762f6c..e5011ee0255 100644 --- a/tests/source/comment_crlf_newline.rs +++ b/tests/source/comment_crlf_newline.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true /* Block comments followed by CRLF newlines should not an extra newline at the end */ /* Something else */ diff --git a/tests/source/comments-in-lists/wrap-comments-not-normalized.rs b/tests/source/comments-in-lists/wrap-comments-not-normalized.rs index b96c02802d6..c7a1ec05988 100644 --- a/tests/source/comments-in-lists/wrap-comments-not-normalized.rs +++ b/tests/source/comments-in-lists/wrap-comments-not-normalized.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // https://github.com/rust-lang/rustfmt/issues/4909 pub enum E { diff --git a/tests/source/comments-in-lists/wrap-comments-true.rs b/tests/source/comments-in-lists/wrap-comments-true.rs index 360b838520e..5e14ac604f7 100644 --- a/tests/source/comments-in-lists/wrap-comments-true.rs +++ b/tests/source/comments-in-lists/wrap-comments-true.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true // https://github.com/rust-lang/rustfmt/issues/4909 pub enum E { diff --git a/tests/source/configs/blank_lines_lower_bound/1.rs b/tests/source/configs/blank_lines_lower_bound/1.rs index c6058a55b0a..c9d2136c851 100644 --- a/tests/source/configs/blank_lines_lower_bound/1.rs +++ b/tests/source/configs/blank_lines_lower_bound/1.rs @@ -1,4 +1,4 @@ -// rustfmt-blank_lines_lower_bound: 1 +//@ rustfmt-blank_lines_lower_bound: 1 fn foo() {} fn bar() {} diff --git a/tests/source/configs/blank_lines_upper_bound/1.rs b/tests/source/configs/blank_lines_upper_bound/1.rs index 1ddae0bbe19..1a58ffa811e 100644 --- a/tests/source/configs/blank_lines_upper_bound/1.rs +++ b/tests/source/configs/blank_lines_upper_bound/1.rs @@ -1,4 +1,4 @@ -// rustfmt-blank_lines_upper_bound: 1 +//@ rustfmt-blank_lines_upper_bound: 1 fn do_stuff() diff --git a/tests/source/configs/blank_lines_upper_bound/2.rs b/tests/source/configs/blank_lines_upper_bound/2.rs index caaaa006c0e..18f9736f061 100644 --- a/tests/source/configs/blank_lines_upper_bound/2.rs +++ b/tests/source/configs/blank_lines_upper_bound/2.rs @@ -1,4 +1,4 @@ -// rustfmt-blank_lines_upper_bound: 2 +//@ rustfmt-blank_lines_upper_bound: 2 fn do_stuff() diff --git a/tests/source/configs/brace_style/fn_always_next_line.rs b/tests/source/configs/brace_style/fn_always_next_line.rs index d3bd9ac09aa..049f9570d39 100644 --- a/tests/source/configs/brace_style/fn_always_next_line.rs +++ b/tests/source/configs/brace_style/fn_always_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine // Function brace style fn lorem() { diff --git a/tests/source/configs/brace_style/fn_prefer_same_line.rs b/tests/source/configs/brace_style/fn_prefer_same_line.rs index 78a4495243d..c54e80c7954 100644 --- a/tests/source/configs/brace_style/fn_prefer_same_line.rs +++ b/tests/source/configs/brace_style/fn_prefer_same_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Function brace style fn lorem() { diff --git a/tests/source/configs/brace_style/fn_same_line_where.rs b/tests/source/configs/brace_style/fn_same_line_where.rs index 3b78932e177..c7f717ee483 100644 --- a/tests/source/configs/brace_style/fn_same_line_where.rs +++ b/tests/source/configs/brace_style/fn_same_line_where.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: SameLineWhere +//@ rustfmt-brace_style: SameLineWhere // Function brace style fn lorem() { diff --git a/tests/source/configs/brace_style/item_always_next_line.rs b/tests/source/configs/brace_style/item_always_next_line.rs index 0cc19b34da7..f00b44e9960 100644 --- a/tests/source/configs/brace_style/item_always_next_line.rs +++ b/tests/source/configs/brace_style/item_always_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine // Item brace style enum Foo {} diff --git a/tests/source/configs/brace_style/item_prefer_same_line.rs b/tests/source/configs/brace_style/item_prefer_same_line.rs index 4412bc869a2..6a4c532b5d0 100644 --- a/tests/source/configs/brace_style/item_prefer_same_line.rs +++ b/tests/source/configs/brace_style/item_prefer_same_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Item brace style struct Lorem { diff --git a/tests/source/configs/brace_style/item_same_line_where.rs b/tests/source/configs/brace_style/item_same_line_where.rs index b8e69147dc5..daf16ff2632 100644 --- a/tests/source/configs/brace_style/item_same_line_where.rs +++ b/tests/source/configs/brace_style/item_same_line_where.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: SameLineWhere +//@ rustfmt-brace_style: SameLineWhere // Item brace style struct Lorem { diff --git a/tests/source/configs/chain_width/always.rs b/tests/source/configs/chain_width/always.rs index 2d16d66aec1..e235d3aa992 100644 --- a/tests/source/configs/chain_width/always.rs +++ b/tests/source/configs/chain_width/always.rs @@ -1,4 +1,4 @@ -// rustfmt-chain_width: 1 +//@ rustfmt-chain_width: 1 // setting an unachievable chain_width to always get chains // on separate lines diff --git a/tests/source/configs/chain_width/small.rs b/tests/source/configs/chain_width/small.rs index 26f9354537a..478b6caceae 100644 --- a/tests/source/configs/chain_width/small.rs +++ b/tests/source/configs/chain_width/small.rs @@ -1,4 +1,4 @@ -// rustfmt-chain_width: 40 +//@ rustfmt-chain_width: 40 struct Fluent {} diff --git a/tests/source/configs/chain_width/tiny.rs b/tests/source/configs/chain_width/tiny.rs index fffc81dd5d6..7ae45e60773 100644 --- a/tests/source/configs/chain_width/tiny.rs +++ b/tests/source/configs/chain_width/tiny.rs @@ -1,4 +1,4 @@ -// rustfmt-chain_width: 20 +//@ rustfmt-chain_width: 20 struct Fluent {} diff --git a/tests/source/configs/comment_width/above.rs b/tests/source/configs/comment_width/above.rs index 36187ce0af4..1fbd968a026 100644 --- a/tests/source/configs/comment_width/above.rs +++ b/tests/source/configs/comment_width/above.rs @@ -1,5 +1,5 @@ -// rustfmt-comment_width: 40 -// rustfmt-wrap_comments: true +//@ rustfmt-comment_width: 40 +//@ rustfmt-wrap_comments: true // Comment width fn main() { diff --git a/tests/source/configs/comment_width/below.rs b/tests/source/configs/comment_width/below.rs index abbc5930c4c..11c0d925cd7 100644 --- a/tests/source/configs/comment_width/below.rs +++ b/tests/source/configs/comment_width/below.rs @@ -1,5 +1,5 @@ -// rustfmt-comment_width: 80 -// rustfmt-wrap_comments: true +//@ rustfmt-comment_width: 80 +//@ rustfmt-wrap_comments: true // Comment width fn main() { diff --git a/tests/source/configs/comment_width/ignore.rs b/tests/source/configs/comment_width/ignore.rs index c86e71c2898..6adb0ff1e0b 100644 --- a/tests/source/configs/comment_width/ignore.rs +++ b/tests/source/configs/comment_width/ignore.rs @@ -1,5 +1,5 @@ -// rustfmt-comment_width: 40 -// rustfmt-wrap_comments: false +//@ rustfmt-comment_width: 40 +//@ rustfmt-wrap_comments: false // Comment width fn main() { diff --git a/tests/source/configs/condense_wildcard_suffixes/false.rs b/tests/source/configs/condense_wildcard_suffixes/false.rs index 3b967f35a8e..f0e52ead0aa 100644 --- a/tests/source/configs/condense_wildcard_suffixes/false.rs +++ b/tests/source/configs/condense_wildcard_suffixes/false.rs @@ -1,4 +1,4 @@ -// rustfmt-condense_wildcard_suffixes: false +//@ rustfmt-condense_wildcard_suffixes: false // Condense wildcard suffixes fn main() { diff --git a/tests/source/configs/condense_wildcard_suffixes/true.rs b/tests/source/configs/condense_wildcard_suffixes/true.rs index 3798a6b9902..0a445406cfb 100644 --- a/tests/source/configs/condense_wildcard_suffixes/true.rs +++ b/tests/source/configs/condense_wildcard_suffixes/true.rs @@ -1,4 +1,4 @@ -// rustfmt-condense_wildcard_suffixes: true +//@ rustfmt-condense_wildcard_suffixes: true // Condense wildcard suffixes fn main() { diff --git a/tests/source/configs/control_brace_style/always_next_line.rs b/tests/source/configs/control_brace_style/always_next_line.rs index c4ddad9ce27..5b6bc67ec25 100644 --- a/tests/source/configs/control_brace_style/always_next_line.rs +++ b/tests/source/configs/control_brace_style/always_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-control_brace_style: AlwaysNextLine // Control brace style fn main() { diff --git a/tests/source/configs/control_brace_style/always_same_line.rs b/tests/source/configs/control_brace_style/always_same_line.rs index a9c699d27e3..68cc6d706ab 100644 --- a/tests/source/configs/control_brace_style/always_same_line.rs +++ b/tests/source/configs/control_brace_style/always_same_line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysSameLine +//@ rustfmt-control_brace_style: AlwaysSameLine // Control brace style fn main() { diff --git a/tests/source/configs/control_brace_style/closing_next_line.rs b/tests/source/configs/control_brace_style/closing_next_line.rs index 1a74a28f26a..6fe1663f6a9 100644 --- a/tests/source/configs/control_brace_style/closing_next_line.rs +++ b/tests/source/configs/control_brace_style/closing_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: ClosingNextLine +//@ rustfmt-control_brace_style: ClosingNextLine // Control brace style fn main() { diff --git a/tests/source/configs/disable_all_formatting/false.rs b/tests/source/configs/disable_all_formatting/false.rs index 834ca7a3c89..c98274a0cf5 100644 --- a/tests/source/configs/disable_all_formatting/false.rs +++ b/tests/source/configs/disable_all_formatting/false.rs @@ -1,4 +1,4 @@ -// rustfmt-disable_all_formatting: false +//@ rustfmt-disable_all_formatting: false // Disable all formatting fn main() { diff --git a/tests/source/configs/disable_all_formatting/true.rs b/tests/source/configs/disable_all_formatting/true.rs index 56955bf384d..3cd175150e5 100644 --- a/tests/source/configs/disable_all_formatting/true.rs +++ b/tests/source/configs/disable_all_formatting/true.rs @@ -1,4 +1,4 @@ -// rustfmt-disable_all_formatting: true +//@ rustfmt-disable_all_formatting: true // Disable all formatting fn main() { diff --git a/tests/source/configs/doc_comment_code_block_small_heuristics/default-to-max.rs b/tests/source/configs/doc_comment_code_block_small_heuristics/default-to-max.rs index dcaa89367f8..135a61e60ea 100644 --- a/tests/source/configs/doc_comment_code_block_small_heuristics/default-to-max.rs +++ b/tests/source/configs/doc_comment_code_block_small_heuristics/default-to-max.rs @@ -1,6 +1,6 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-use_small_heuristics: Default -// rustfmt-doc_comment_code_block_small_heuristics: Max +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-use_small_heuristics: Default +//@ rustfmt-doc_comment_code_block_small_heuristics: Max /// Start of a doc comment. /// diff --git a/tests/source/configs/doc_comment_code_block_small_heuristics/max-to-default.rs b/tests/source/configs/doc_comment_code_block_small_heuristics/max-to-default.rs index b9aa3211aaf..94b493601b9 100644 --- a/tests/source/configs/doc_comment_code_block_small_heuristics/max-to-default.rs +++ b/tests/source/configs/doc_comment_code_block_small_heuristics/max-to-default.rs @@ -1,6 +1,6 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-use_small_heuristics: Max -// rustfmt-doc_comment_code_block_small_heuristics: Default +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-use_small_heuristics: Max +//@ rustfmt-doc_comment_code_block_small_heuristics: Default /// Start of a doc comment. /// diff --git a/tests/source/configs/doc_comment_code_block_width/100.rs b/tests/source/configs/doc_comment_code_block_width/100.rs index 51578076167..403a3b48cb9 100644 --- a/tests/source/configs/doc_comment_code_block_width/100.rs +++ b/tests/source/configs/doc_comment_code_block_width/100.rs @@ -1,5 +1,5 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-doc_comment_code_block_width: 100 +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-doc_comment_code_block_width: 100 /// ```rust /// impl Test { diff --git a/tests/source/configs/doc_comment_code_block_width/100_greater_max_width.rs b/tests/source/configs/doc_comment_code_block_width/100_greater_max_width.rs index 96505c69714..aa60ce7ae40 100644 --- a/tests/source/configs/doc_comment_code_block_width/100_greater_max_width.rs +++ b/tests/source/configs/doc_comment_code_block_width/100_greater_max_width.rs @@ -1,6 +1,6 @@ -// rustfmt-max_width: 50 -// rustfmt-format_code_in_doc_comments: true -// rustfmt-doc_comment_code_block_width: 100 +//@ rustfmt-max_width: 50 +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-doc_comment_code_block_width: 100 /// ```rust /// impl Test { diff --git a/tests/source/configs/doc_comment_code_block_width/50.rs b/tests/source/configs/doc_comment_code_block_width/50.rs index 2c6307951c8..457b76d303b 100644 --- a/tests/source/configs/doc_comment_code_block_width/50.rs +++ b/tests/source/configs/doc_comment_code_block_width/50.rs @@ -1,5 +1,5 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-doc_comment_code_block_width: 50 +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-doc_comment_code_block_width: 50 /// ```rust /// impl Test { diff --git a/tests/source/configs/empty_item_single_line/false.rs b/tests/source/configs/empty_item_single_line/false.rs index 9bfb2b964ea..b3bee2fc105 100644 --- a/tests/source/configs/empty_item_single_line/false.rs +++ b/tests/source/configs/empty_item_single_line/false.rs @@ -1,4 +1,4 @@ -// rustfmt-empty_item_single_line: false +//@ rustfmt-empty_item_single_line: false // Empty impl on single line impl Lorem { diff --git a/tests/source/configs/empty_item_single_line/true.rs b/tests/source/configs/empty_item_single_line/true.rs index 8af8b88ffff..a517a465d3d 100644 --- a/tests/source/configs/empty_item_single_line/true.rs +++ b/tests/source/configs/empty_item_single_line/true.rs @@ -1,4 +1,4 @@ -// rustfmt-empty_item_single_line: true +//@ rustfmt-empty_item_single_line: true // Empty impl on single line impl Lorem { diff --git a/tests/source/configs/enum_discrim_align_threshold/40.rs b/tests/source/configs/enum_discrim_align_threshold/40.rs index 796e47c384b..db67c4409c2 100644 --- a/tests/source/configs/enum_discrim_align_threshold/40.rs +++ b/tests/source/configs/enum_discrim_align_threshold/40.rs @@ -1,4 +1,4 @@ -// rustfmt-enum_discrim_align_threshold: 40 +//@ rustfmt-enum_discrim_align_threshold: 40 enum Standard { A = 1, diff --git a/tests/source/configs/error_on_line_overflow/false.rs b/tests/source/configs/error_on_line_overflow/false.rs index fa70ae78352..e064e776488 100644 --- a/tests/source/configs/error_on_line_overflow/false.rs +++ b/tests/source/configs/error_on_line_overflow/false.rs @@ -1,4 +1,4 @@ -// rustfmt-error_on_line_overflow: false +//@ rustfmt-error_on_line_overflow: false // Error on line overflow fn main() { diff --git a/tests/source/configs/float_literal_trailing_zero/always.rs b/tests/source/configs/float_literal_trailing_zero/always.rs index 8ac9737648f..ec4671a9ae4 100644 --- a/tests/source/configs/float_literal_trailing_zero/always.rs +++ b/tests/source/configs/float_literal_trailing_zero/always.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: Always +//@ rustfmt-float_literal_trailing_zero: Always // spaces_around_ranges: false is implied since it's the default fn float_literals() { diff --git a/tests/source/configs/float_literal_trailing_zero/if-no-postfix.rs b/tests/source/configs/float_literal_trailing_zero/if-no-postfix.rs index 4889203b616..4c605fbd479 100644 --- a/tests/source/configs/float_literal_trailing_zero/if-no-postfix.rs +++ b/tests/source/configs/float_literal_trailing_zero/if-no-postfix.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: IfNoPostfix +//@ rustfmt-float_literal_trailing_zero: IfNoPostfix // spaces_around_ranges: false is implied since it's the default fn float_literals() { diff --git a/tests/source/configs/float_literal_trailing_zero/never.rs b/tests/source/configs/float_literal_trailing_zero/never.rs index f07bc4db20f..0ab715e4381 100644 --- a/tests/source/configs/float_literal_trailing_zero/never.rs +++ b/tests/source/configs/float_literal_trailing_zero/never.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: Never +//@ rustfmt-float_literal_trailing_zero: Never // spaces_around_ranges: false is implied since it's the default fn float_literals() { diff --git a/tests/source/configs/fn_params_layout/compressed.rs b/tests/source/configs/fn_params_layout/compressed.rs index eb573d3121f..f09385df4ec 100644 --- a/tests/source/configs/fn_params_layout/compressed.rs +++ b/tests/source/configs/fn_params_layout/compressed.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Compressed +//@ rustfmt-fn_params_layout: Compressed // Function arguments density trait Lorem { diff --git a/tests/source/configs/fn_params_layout/tall.rs b/tests/source/configs/fn_params_layout/tall.rs index 4be34f0fe4a..1badf432d34 100644 --- a/tests/source/configs/fn_params_layout/tall.rs +++ b/tests/source/configs/fn_params_layout/tall.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Tall +//@ rustfmt-fn_params_layout: Tall // Function arguments density trait Lorem { diff --git a/tests/source/configs/fn_params_layout/vertical.rs b/tests/source/configs/fn_params_layout/vertical.rs index 9f4ea419d9c..a027c2d81f9 100644 --- a/tests/source/configs/fn_params_layout/vertical.rs +++ b/tests/source/configs/fn_params_layout/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Vertical +//@ rustfmt-fn_params_layout: Vertical // Function arguments density trait Lorem { diff --git a/tests/source/configs/fn_params_layout/vertical_style_2027.rs b/tests/source/configs/fn_params_layout/vertical_style_2027.rs index 07c6905ed5e..36a3efa1ba6 100644 --- a/tests/source/configs/fn_params_layout/vertical_style_2027.rs +++ b/tests/source/configs/fn_params_layout/vertical_style_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-fn_params_layout: Vertical +//@ rustfmt-style_edition: 2027 +//@ rustfmt-fn_params_layout: Vertical // Function arguments density trait Lorem { diff --git a/tests/source/configs/fn_single_line/false.rs b/tests/source/configs/fn_single_line/false.rs index 3d092f0c0bf..da4e24fd72a 100644 --- a/tests/source/configs/fn_single_line/false.rs +++ b/tests/source/configs/fn_single_line/false.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_single_line: false +//@ rustfmt-fn_single_line: false // Single-expression function on single line fn lorem() -> usize { diff --git a/tests/source/configs/fn_single_line/true.rs b/tests/source/configs/fn_single_line/true.rs index 3cb0fdedf0b..f0b8f17332e 100644 --- a/tests/source/configs/fn_single_line/true.rs +++ b/tests/source/configs/fn_single_line/true.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_single_line: true +//@ rustfmt-fn_single_line: true // Single-expression function on single line fn lorem() -> usize { diff --git a/tests/source/configs/force_explicit_abi/false.rs b/tests/source/configs/force_explicit_abi/false.rs index 3c48f8e0c78..9ab1865fc07 100644 --- a/tests/source/configs/force_explicit_abi/false.rs +++ b/tests/source/configs/force_explicit_abi/false.rs @@ -1,4 +1,4 @@ -// rustfmt-force_explicit_abi: false +//@ rustfmt-force_explicit_abi: false // Force explicit abi extern { diff --git a/tests/source/configs/force_explicit_abi/true.rs b/tests/source/configs/force_explicit_abi/true.rs index e5ff6cf7dd7..eba2c639857 100644 --- a/tests/source/configs/force_explicit_abi/true.rs +++ b/tests/source/configs/force_explicit_abi/true.rs @@ -1,4 +1,4 @@ -// rustfmt-force_explicit_abi: true +//@ rustfmt-force_explicit_abi: true // Force explicit abi extern { diff --git a/tests/source/configs/force_multiline_block/false.rs b/tests/source/configs/force_multiline_block/false.rs index b97e348e5da..c479955e83a 100644 --- a/tests/source/configs/force_multiline_block/false.rs +++ b/tests/source/configs/force_multiline_block/false.rs @@ -1,4 +1,4 @@ -// rustfmt-force_multiline_blocks: false +//@ rustfmt-force_multiline_blocks: false // Option forces multiline match arm and closure bodies to be wrapped in a block fn main() { diff --git a/tests/source/configs/force_multiline_block/true.rs b/tests/source/configs/force_multiline_block/true.rs index db9d3de4614..314479f4df0 100644 --- a/tests/source/configs/force_multiline_block/true.rs +++ b/tests/source/configs/force_multiline_block/true.rs @@ -1,4 +1,4 @@ -// rustfmt-force_multiline_blocks: true +//@ rustfmt-force_multiline_blocks: true // Option forces multiline match arm and closure bodies to be wrapped in a block fn main() { diff --git a/tests/source/configs/format_generated_files/false.rs b/tests/source/configs/format_generated_files/false.rs index dec1e00d117..aa9c83b4094 100644 --- a/tests/source/configs/format_generated_files/false.rs +++ b/tests/source/configs/format_generated_files/false.rs @@ -1,5 +1,5 @@ // @generated -// rustfmt-format_generated_files: false +//@ rustfmt-format_generated_files: false fn main() { diff --git a/tests/source/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs b/tests/source/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs index be03849fe10..f10a83f7900 100644 --- a/tests/source/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs +++ b/tests/source/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: false -// rustfmt-generated_marker_line_search_limit: 15 +//@ rustfmt-format_generated_files: false +//@ rustfmt-generated_marker_line_search_limit: 15 fn main() { diff --git a/tests/source/configs/format_generated_files/false_with_marker_out_scope_size.rs b/tests/source/configs/format_generated_files/false_with_marker_out_scope_size.rs index abb97e6259f..8e18c47a007 100644 --- a/tests/source/configs/format_generated_files/false_with_marker_out_scope_size.rs +++ b/tests/source/configs/format_generated_files/false_with_marker_out_scope_size.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: false -// rustfmt-generated_marker_line_search_limit: 1 +//@ rustfmt-format_generated_files: false +//@ rustfmt-generated_marker_line_search_limit: 1 fn main() { diff --git a/tests/source/configs/format_generated_files/false_with_zero_search_limit.rs b/tests/source/configs/format_generated_files/false_with_zero_search_limit.rs index f6978d0f355..268f298ddcf 100644 --- a/tests/source/configs/format_generated_files/false_with_zero_search_limit.rs +++ b/tests/source/configs/format_generated_files/false_with_zero_search_limit.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: false -// rustfmt-generated_marker_line_search_limit: 0 +//@ rustfmt-format_generated_files: false +//@ rustfmt-generated_marker_line_search_limit: 0 // @generated fn main() { diff --git a/tests/source/configs/format_generated_files/true.rs b/tests/source/configs/format_generated_files/true.rs index a25ddc25a6a..606b9e2e870 100644 --- a/tests/source/configs/format_generated_files/true.rs +++ b/tests/source/configs/format_generated_files/true.rs @@ -1,5 +1,5 @@ // @generated -// rustfmt-format_generated_files: true +//@ rustfmt-format_generated_files: true fn main() { diff --git a/tests/source/configs/format_generated_files/true_with_marker_in_scope_size.rs b/tests/source/configs/format_generated_files/true_with_marker_in_scope_size.rs index 53cc116ec2b..a64cc570d3e 100644 --- a/tests/source/configs/format_generated_files/true_with_marker_in_scope_size.rs +++ b/tests/source/configs/format_generated_files/true_with_marker_in_scope_size.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: true -// rustfmt-generated_marker_line_search_limit: 20 +//@ rustfmt-format_generated_files: true +//@ rustfmt-generated_marker_line_search_limit: 20 fn main() { diff --git a/tests/source/configs/format_generated_files/true_with_marker_not_in_header.rs b/tests/source/configs/format_generated_files/true_with_marker_not_in_header.rs index 8eff1a3b0ee..2ef87b5fb73 100644 --- a/tests/source/configs/format_generated_files/true_with_marker_not_in_header.rs +++ b/tests/source/configs/format_generated_files/true_with_marker_not_in_header.rs @@ -1,4 +1,4 @@ -// rustfmt-format_generated_files: true +//@ rustfmt-format_generated_files: true fn main() { diff --git a/tests/source/configs/format_macro_bodies/false.rs b/tests/source/configs/format_macro_bodies/false.rs index d618a1ac3f9..14c12be7cfc 100644 --- a/tests/source/configs/format_macro_bodies/false.rs +++ b/tests/source/configs/format_macro_bodies/false.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: false +//@ rustfmt-format_macro_bodies: false macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/source/configs/format_macro_bodies/true.rs b/tests/source/configs/format_macro_bodies/true.rs index b254b82d719..579f1ab51dc 100644 --- a/tests/source/configs/format_macro_bodies/true.rs +++ b/tests/source/configs/format_macro_bodies/true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: true +//@ rustfmt-format_macro_bodies: true macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/source/configs/format_macro_matchers/false.rs b/tests/source/configs/format_macro_matchers/false.rs index a721bb55c23..1a183b37da1 100644 --- a/tests/source/configs/format_macro_matchers/false.rs +++ b/tests/source/configs/format_macro_matchers/false.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: false +//@ rustfmt-format_macro_matchers: false macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/source/configs/format_macro_matchers/true.rs b/tests/source/configs/format_macro_matchers/true.rs index fa0442e228a..bec84325463 100644 --- a/tests/source/configs/format_macro_matchers/true.rs +++ b/tests/source/configs/format_macro_matchers/true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: true +//@ rustfmt-format_macro_matchers: true macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/source/configs/format_strings/false.rs b/tests/source/configs/format_strings/false.rs index ecca0d7d1fc..451d8283965 100644 --- a/tests/source/configs/format_strings/false.rs +++ b/tests/source/configs/format_strings/false.rs @@ -1,6 +1,6 @@ -// rustfmt-format_strings: false -// rustfmt-max_width: 50 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-format_strings: false +//@ rustfmt-max_width: 50 +//@ rustfmt-error_on_line_overflow: false // Force format strings fn main() { diff --git a/tests/source/configs/format_strings/true.rs b/tests/source/configs/format_strings/true.rs index 33731447821..9bec2f44ccb 100644 --- a/tests/source/configs/format_strings/true.rs +++ b/tests/source/configs/format_strings/true.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 // Force format strings fn main() { diff --git a/tests/source/configs/group_imports/One-merge_imports.rs b/tests/source/configs/group_imports/One-merge_imports.rs index 157d3857908..6d2ae039225 100644 --- a/tests/source/configs/group_imports/One-merge_imports.rs +++ b/tests/source/configs/group_imports/One-merge_imports.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: One -// rustfmt-imports_granularity: Crate +//@ rustfmt-group_imports: One +//@ rustfmt-imports_granularity: Crate use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/group_imports/One-nested.rs b/tests/source/configs/group_imports/One-nested.rs index 109bd07e1ee..3f3c0de4ff1 100644 --- a/tests/source/configs/group_imports/One-nested.rs +++ b/tests/source/configs/group_imports/One-nested.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: One +//@ rustfmt-group_imports: One mod test { use crate::foo::bar; diff --git a/tests/source/configs/group_imports/One-no_reorder.rs b/tests/source/configs/group_imports/One-no_reorder.rs index f82f62c7f5b..716831a77c9 100644 --- a/tests/source/configs/group_imports/One-no_reorder.rs +++ b/tests/source/configs/group_imports/One-no_reorder.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: One -// rustfmt-reorder_imports: false +//@ rustfmt-group_imports: One +//@ rustfmt-reorder_imports: false use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/group_imports/One.rs b/tests/source/configs/group_imports/One.rs index 5ab7a950805..4ad04fdc4ae 100644 --- a/tests/source/configs/group_imports/One.rs +++ b/tests/source/configs/group_imports/One.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: One +//@ rustfmt-group_imports: One use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/group_imports/StdExternalCrate-merge_imports.rs b/tests/source/configs/group_imports/StdExternalCrate-merge_imports.rs index ea7f6280a64..7f1cd8b8c71 100644 --- a/tests/source/configs/group_imports/StdExternalCrate-merge_imports.rs +++ b/tests/source/configs/group_imports/StdExternalCrate-merge_imports.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: StdExternalCrate -// rustfmt-imports_granularity: Crate +//@ rustfmt-group_imports: StdExternalCrate +//@ rustfmt-imports_granularity: Crate use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/group_imports/StdExternalCrate-nested.rs b/tests/source/configs/group_imports/StdExternalCrate-nested.rs index 08f4e07b704..ea2766142c3 100644 --- a/tests/source/configs/group_imports/StdExternalCrate-nested.rs +++ b/tests/source/configs/group_imports/StdExternalCrate-nested.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-group_imports: StdExternalCrate mod test { use crate::foo::bar; use std::path; diff --git a/tests/source/configs/group_imports/StdExternalCrate-no_reorder.rs b/tests/source/configs/group_imports/StdExternalCrate-no_reorder.rs index 08c9a72ae61..a849e954856 100644 --- a/tests/source/configs/group_imports/StdExternalCrate-no_reorder.rs +++ b/tests/source/configs/group_imports/StdExternalCrate-no_reorder.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: StdExternalCrate -// rustfmt-reorder_imports: false +//@ rustfmt-group_imports: StdExternalCrate +//@ rustfmt-reorder_imports: false use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/group_imports/StdExternalCrate-non_consecutive.rs b/tests/source/configs/group_imports/StdExternalCrate-non_consecutive.rs index f239a0efa08..0568e276f78 100644 --- a/tests/source/configs/group_imports/StdExternalCrate-non_consecutive.rs +++ b/tests/source/configs/group_imports/StdExternalCrate-non_consecutive.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-group_imports: StdExternalCrate use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/group_imports/StdExternalCrate.rs b/tests/source/configs/group_imports/StdExternalCrate.rs index d49c8941e6d..dfdd663ae8b 100644 --- a/tests/source/configs/group_imports/StdExternalCrate.rs +++ b/tests/source/configs/group_imports/StdExternalCrate.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-group_imports: StdExternalCrate use chrono::Utc; use super::update::convert_publish_payload; diff --git a/tests/source/configs/hard_tabs/false.rs b/tests/source/configs/hard_tabs/false.rs index bf92162b424..e5f47c12e11 100644 --- a/tests/source/configs/hard_tabs/false.rs +++ b/tests/source/configs/hard_tabs/false.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: false +//@ rustfmt-hard_tabs: false // Hard tabs fn lorem() -> usize { diff --git a/tests/source/configs/hard_tabs/true.rs b/tests/source/configs/hard_tabs/true.rs index 738922a4dfb..ca8b409b99e 100644 --- a/tests/source/configs/hard_tabs/true.rs +++ b/tests/source/configs/hard_tabs/true.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true // Hard tabs fn lorem() -> usize { diff --git a/tests/source/configs/hex_literal_case/hex_literal_lower.rs b/tests/source/configs/hex_literal_case/hex_literal_lower.rs index de2c9f9d9dc..6a8f311aa02 100644 --- a/tests/source/configs/hex_literal_case/hex_literal_lower.rs +++ b/tests/source/configs/hex_literal_case/hex_literal_lower.rs @@ -1,4 +1,4 @@ -// rustfmt-hex_literal_case: Lower +//@ rustfmt-hex_literal_case: Lower fn main() { let h1 = 0xCAFE_5EA7; let h2 = 0xCAFE_F00Du32; diff --git a/tests/source/configs/hex_literal_case/hex_literal_preserve.rs b/tests/source/configs/hex_literal_case/hex_literal_preserve.rs index 876592a4f64..3bdc855e3cb 100644 --- a/tests/source/configs/hex_literal_case/hex_literal_preserve.rs +++ b/tests/source/configs/hex_literal_case/hex_literal_preserve.rs @@ -1,4 +1,4 @@ -// rustfmt-hex_literal_case: Preserve +//@ rustfmt-hex_literal_case: Preserve fn main() { let h1 = 0xcAfE_5Ea7; let h2 = 0xCaFe_F00du32; diff --git a/tests/source/configs/hex_literal_case/hex_literal_upper.rs b/tests/source/configs/hex_literal_case/hex_literal_upper.rs index d3fbe367185..a027d1171ed 100644 --- a/tests/source/configs/hex_literal_case/hex_literal_upper.rs +++ b/tests/source/configs/hex_literal_case/hex_literal_upper.rs @@ -1,4 +1,4 @@ -// rustfmt-hex_literal_case: Upper +//@ rustfmt-hex_literal_case: Upper fn main() { let h1 = 0xCaFE_5ea7; let h2 = 0xCAFE_F00Du32; diff --git a/tests/source/configs/imports_layout/merge_mixed.rs b/tests/source/configs/imports_layout/merge_mixed.rs index 477c4aa1684..0a31e008583 100644 --- a/tests/source/configs/imports_layout/merge_mixed.rs +++ b/tests/source/configs/imports_layout/merge_mixed.rs @@ -1,6 +1,6 @@ -// rustfmt-imports_indent: Block -// rustfmt-imports_granularity: Crate -// rustfmt-imports_layout: Mixed +//@ rustfmt-imports_indent: Block +//@ rustfmt-imports_granularity: Crate +//@ rustfmt-imports_layout: Mixed use std::{fmt, io, str}; use std::str::FromStr; diff --git a/tests/source/configs/indent_style/block_args.rs b/tests/source/configs/indent_style/block_args.rs index 4d2d280a16b..57ebc722bd9 100644 --- a/tests/source/configs/indent_style/block_args.rs +++ b/tests/source/configs/indent_style/block_args.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Function arguments layout fn lorem() {} diff --git a/tests/source/configs/indent_style/block_array.rs b/tests/source/configs/indent_style/block_array.rs index 8404f65f471..95952edb169 100644 --- a/tests/source/configs/indent_style/block_array.rs +++ b/tests/source/configs/indent_style/block_array.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Array layout fn main() { diff --git a/tests/source/configs/indent_style/block_call.rs b/tests/source/configs/indent_style/block_call.rs index c82b6b8e38f..cbd20a5e681 100644 --- a/tests/source/configs/indent_style/block_call.rs +++ b/tests/source/configs/indent_style/block_call.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Function call style fn main() { diff --git a/tests/source/configs/indent_style/block_chain.rs b/tests/source/configs/indent_style/block_chain.rs index 41d91469114..b150f8ea840 100644 --- a/tests/source/configs/indent_style/block_chain.rs +++ b/tests/source/configs/indent_style/block_chain.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Chain indent fn main() { diff --git a/tests/source/configs/indent_style/block_generic.rs b/tests/source/configs/indent_style/block_generic.rs index 2cf17be56ef..5760ad80e00 100644 --- a/tests/source/configs/indent_style/block_generic.rs +++ b/tests/source/configs/indent_style/block_generic.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Generics indent fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, adipiscing: Adipiscing, consectetur: Consectetur, elit: Elit) -> T { diff --git a/tests/source/configs/indent_style/block_struct_lit.rs b/tests/source/configs/indent_style/block_struct_lit.rs index 47a6994f40c..60492588924 100644 --- a/tests/source/configs/indent_style/block_struct_lit.rs +++ b/tests/source/configs/indent_style/block_struct_lit.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Struct literal-style fn main() { diff --git a/tests/source/configs/indent_style/block_trailing_comma_call/one.rs b/tests/source/configs/indent_style/block_trailing_comma_call/one.rs index 66e2f538415..1d68533fecd 100644 --- a/tests/source/configs/indent_style/block_trailing_comma_call/one.rs +++ b/tests/source/configs/indent_style/block_trailing_comma_call/one.rs @@ -1,6 +1,6 @@ -// rustfmt-style_edition: 2015 -// rustfmt-error_on_line_overflow: false -// rustfmt-indent_style: Block +//@ rustfmt-style_edition: 2015 +//@ rustfmt-error_on_line_overflow: false +//@ rustfmt-indent_style: Block // rustfmt should not add trailing comma when rewriting macro. See #1528. fn a() { diff --git a/tests/source/configs/indent_style/block_trailing_comma_call/two.rs b/tests/source/configs/indent_style/block_trailing_comma_call/two.rs index 51aa6376e23..99a88d5cbe1 100644 --- a/tests/source/configs/indent_style/block_trailing_comma_call/two.rs +++ b/tests/source/configs/indent_style/block_trailing_comma_call/two.rs @@ -1,6 +1,6 @@ -// rustfmt-style_edition: 2024 -// rustfmt-error_on_line_overflow: false -// rustfmt-indent_style: Block +//@ rustfmt-style_edition: 2024 +//@ rustfmt-error_on_line_overflow: false +//@ rustfmt-indent_style: Block // rustfmt should not add trailing comma when rewriting macro. See #1528. fn a() { diff --git a/tests/source/configs/indent_style/block_where_pred.rs b/tests/source/configs/indent_style/block_where_pred.rs index 450491f0270..8b898ce15e0 100644 --- a/tests/source/configs/indent_style/block_where_pred.rs +++ b/tests/source/configs/indent_style/block_where_pred.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Where predicate indent fn lorem() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq { diff --git a/tests/source/configs/indent_style/default.rs b/tests/source/configs/indent_style/default.rs index f08f5c64460..e20051416f8 100644 --- a/tests/source/configs/indent_style/default.rs +++ b/tests/source/configs/indent_style/default.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Where style fn lorem() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq { diff --git a/tests/source/configs/indent_style/rfc_where.rs b/tests/source/configs/indent_style/rfc_where.rs index 012840be28d..2cbad9bf506 100644 --- a/tests/source/configs/indent_style/rfc_where.rs +++ b/tests/source/configs/indent_style/rfc_where.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Where style fn lorem() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq { diff --git a/tests/source/configs/indent_style/visual_args.rs b/tests/source/configs/indent_style/visual_args.rs index 5aa28a62b9c..070fb17f93f 100644 --- a/tests/source/configs/indent_style/visual_args.rs +++ b/tests/source/configs/indent_style/visual_args.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Function arguments layout fn lorem() {} diff --git a/tests/source/configs/indent_style/visual_array.rs b/tests/source/configs/indent_style/visual_array.rs index 05bbf00b1d2..199f0a7813d 100644 --- a/tests/source/configs/indent_style/visual_array.rs +++ b/tests/source/configs/indent_style/visual_array.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Array layout fn main() { diff --git a/tests/source/configs/indent_style/visual_call.rs b/tests/source/configs/indent_style/visual_call.rs index 9a679d6bb4c..f008e8366ef 100644 --- a/tests/source/configs/indent_style/visual_call.rs +++ b/tests/source/configs/indent_style/visual_call.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Function call style fn main() { diff --git a/tests/source/configs/indent_style/visual_chain.rs b/tests/source/configs/indent_style/visual_chain.rs index b7494875398..c6033dca5a9 100644 --- a/tests/source/configs/indent_style/visual_chain.rs +++ b/tests/source/configs/indent_style/visual_chain.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Chain indent fn main() { diff --git a/tests/source/configs/indent_style/visual_generics.rs b/tests/source/configs/indent_style/visual_generics.rs index 1f910d32d87..c2db01c54d7 100644 --- a/tests/source/configs/indent_style/visual_generics.rs +++ b/tests/source/configs/indent_style/visual_generics.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Generics indent fn lorem(ipsum: Ipsum, dolor: Dolor, sit: Sit, amet: Amet, adipiscing: Adipiscing, consectetur: Consectetur, elit: Elit) -> T { diff --git a/tests/source/configs/indent_style/visual_struct_lit.rs b/tests/source/configs/indent_style/visual_struct_lit.rs index 45538e70482..9b6635664b6 100644 --- a/tests/source/configs/indent_style/visual_struct_lit.rs +++ b/tests/source/configs/indent_style/visual_struct_lit.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Struct literal-style fn main() { diff --git a/tests/source/configs/indent_style/visual_trailing_comma.rs b/tests/source/configs/indent_style/visual_trailing_comma.rs index 9738d397dbf..f0caf842b02 100644 --- a/tests/source/configs/indent_style/visual_trailing_comma.rs +++ b/tests/source/configs/indent_style/visual_trailing_comma.rs @@ -1,5 +1,5 @@ -// rustfmt-error_on_line_overflow: false -// rustfmt-indent_style: Visual +//@ rustfmt-error_on_line_overflow: false +//@ rustfmt-indent_style: Visual // rustfmt should not add trailing comma when rewriting macro. See #1528. fn a() { diff --git a/tests/source/configs/indent_style/visual_where_pred.rs b/tests/source/configs/indent_style/visual_where_pred.rs index 055806b6862..939b1d6cd77 100644 --- a/tests/source/configs/indent_style/visual_where_pred.rs +++ b/tests/source/configs/indent_style/visual_where_pred.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Where predicate indent fn lorem() -> T where Ipsum: Eq, Dolor: Eq, Sit: Eq, Amet: Eq { diff --git a/tests/source/configs/match_arm_blocks/false.rs b/tests/source/configs/match_arm_blocks/false.rs index 53e37e13c4f..c4e77ce5c51 100644 --- a/tests/source/configs/match_arm_blocks/false.rs +++ b/tests/source/configs/match_arm_blocks/false.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_blocks: false +//@ rustfmt-match_arm_blocks: false // Wrap match-arms fn main() { diff --git a/tests/source/configs/match_arm_blocks/true.rs b/tests/source/configs/match_arm_blocks/true.rs index a452b13cd27..1800d50e9cd 100644 --- a/tests/source/configs/match_arm_blocks/true.rs +++ b/tests/source/configs/match_arm_blocks/true.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_blocks: true +//@ rustfmt-match_arm_blocks: true // Wrap match-arms fn main() { diff --git a/tests/source/configs/match_arm_indent/attrs.rs b/tests/source/configs/match_arm_indent/attrs.rs index 0616a612cd0..f213d6ab314 100644 --- a/tests/source/configs/match_arm_indent/attrs.rs +++ b/tests/source/configs/match_arm_indent/attrs.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false fn single_oneline() { match value { #[cfg(sslv2)] Sslv2 => handle(), } diff --git a/tests/source/configs/match_arm_indent/guards.rs b/tests/source/configs/match_arm_indent/guards.rs index ba4df30d6ed..07876c5dbcf 100644 --- a/tests/source/configs/match_arm_indent/guards.rs +++ b/tests/source/configs/match_arm_indent/guards.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false // Guards are indented if the pattern is longer than 6 characters fn test() { diff --git a/tests/source/configs/match_arm_indent/leading_pipes.rs b/tests/source/configs/match_arm_indent/leading_pipes.rs index d090b8f7bf1..77e97d59d36 100644 --- a/tests/source/configs/match_arm_indent/leading_pipes.rs +++ b/tests/source/configs/match_arm_indent/leading_pipes.rs @@ -1,5 +1,5 @@ -// rustfmt-match_arm_indent: false -// rustfmt-match_arm_leading_pipes: Always +//@ rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_leading_pipes: Always fn pipes() { match value { diff --git a/tests/source/configs/match_arm_indent/nested.rs b/tests/source/configs/match_arm_indent/nested.rs index 89e1f635799..9490a7cd738 100644 --- a/tests/source/configs/match_arm_indent/nested.rs +++ b/tests/source/configs/match_arm_indent/nested.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false fn r#match() { match value { diff --git a/tests/source/configs/match_arm_indent/patterns.rs b/tests/source/configs/match_arm_indent/patterns.rs index 3950de48348..c3a4c239b57 100644 --- a/tests/source/configs/match_arm_indent/patterns.rs +++ b/tests/source/configs/match_arm_indent/patterns.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false fn multiple() { match body.kind { diff --git a/tests/source/configs/match_arm_indent/unindent.rs b/tests/source/configs/match_arm_indent/unindent.rs index 9177a381ab3..89b584c79f3 100644 --- a/tests/source/configs/match_arm_indent/unindent.rs +++ b/tests/source/configs/match_arm_indent/unindent.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false // Unindent the match arms fn foo() { diff --git a/tests/source/configs/match_arm_leading_pipes/always.rs b/tests/source/configs/match_arm_leading_pipes/always.rs index 162d812d8cf..2312aaa99c7 100644 --- a/tests/source/configs/match_arm_leading_pipes/always.rs +++ b/tests/source/configs/match_arm_leading_pipes/always.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_leading_pipes: Always +//@ rustfmt-match_arm_leading_pipes: Always fn foo() { match foo { diff --git a/tests/source/configs/match_arm_leading_pipes/never.rs b/tests/source/configs/match_arm_leading_pipes/never.rs index 8a68fe21407..d4073496cd2 100644 --- a/tests/source/configs/match_arm_leading_pipes/never.rs +++ b/tests/source/configs/match_arm_leading_pipes/never.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_leading_pipes: Never +//@ rustfmt-match_arm_leading_pipes: Never fn foo() { match foo { diff --git a/tests/source/configs/match_arm_leading_pipes/preserve.rs b/tests/source/configs/match_arm_leading_pipes/preserve.rs index 5486877bde1..b931b790448 100644 --- a/tests/source/configs/match_arm_leading_pipes/preserve.rs +++ b/tests/source/configs/match_arm_leading_pipes/preserve.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_leading_pipes: Preserve +//@ rustfmt-match_arm_leading_pipes: Preserve fn foo() { match foo { diff --git a/tests/source/configs/match_block_trailing_comma/false.rs b/tests/source/configs/match_block_trailing_comma/false.rs index 70e02955fb0..9f905e5708f 100644 --- a/tests/source/configs/match_block_trailing_comma/false.rs +++ b/tests/source/configs/match_block_trailing_comma/false.rs @@ -1,4 +1,4 @@ -// rustfmt-match_block_trailing_comma: false +//@ rustfmt-match_block_trailing_comma: false // Match block trailing comma fn main() { diff --git a/tests/source/configs/match_block_trailing_comma/true.rs b/tests/source/configs/match_block_trailing_comma/true.rs index b9af3d47202..acb29fda1ee 100644 --- a/tests/source/configs/match_block_trailing_comma/true.rs +++ b/tests/source/configs/match_block_trailing_comma/true.rs @@ -1,4 +1,4 @@ -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-match_block_trailing_comma: true // Match block trailing comma fn main() { diff --git a/tests/source/configs/merge_derives/true.rs b/tests/source/configs/merge_derives/true.rs index 18b8443f0d7..302f24bff2d 100644 --- a/tests/source/configs/merge_derives/true.rs +++ b/tests/source/configs/merge_derives/true.rs @@ -1,4 +1,4 @@ -// rustfmt-merge_derives: true +//@ rustfmt-merge_derives: true // Merge multiple derives to a single one. #[bar] diff --git a/tests/source/configs/normalize_comments/false.rs b/tests/source/configs/normalize_comments/false.rs index 488962ed936..181b44d903e 100644 --- a/tests/source/configs/normalize_comments/false.rs +++ b/tests/source/configs/normalize_comments/false.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: false +//@ rustfmt-normalize_comments: false // Normalize comments // Lorem ipsum: diff --git a/tests/source/configs/normalize_comments/true.rs b/tests/source/configs/normalize_comments/true.rs index c74a9808e61..d8808241569 100644 --- a/tests/source/configs/normalize_comments/true.rs +++ b/tests/source/configs/normalize_comments/true.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Normalize comments // Lorem ipsum: diff --git a/tests/source/configs/normalize_doc_attributes/false.rs b/tests/source/configs/normalize_doc_attributes/false.rs index f8eb64273c3..4504624af2a 100644 --- a/tests/source/configs/normalize_doc_attributes/false.rs +++ b/tests/source/configs/normalize_doc_attributes/false.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_doc_attributes: false +//@ rustfmt-normalize_doc_attributes: false // Normalize doc attributes #![doc = " Example documentation"] diff --git a/tests/source/configs/normalize_doc_attributes/true.rs b/tests/source/configs/normalize_doc_attributes/true.rs index 894c00a4dc0..c8e9d3c4679 100644 --- a/tests/source/configs/normalize_doc_attributes/true.rs +++ b/tests/source/configs/normalize_doc_attributes/true.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-normalize_doc_attributes: true // Normalize doc attributes #![doc = " Example documentation"] diff --git a/tests/source/configs/remove_nested_parens/remove_nested_parens.rs b/tests/source/configs/remove_nested_parens/remove_nested_parens.rs index 87aed09c14a..85df5d71b95 100644 --- a/tests/source/configs/remove_nested_parens/remove_nested_parens.rs +++ b/tests/source/configs/remove_nested_parens/remove_nested_parens.rs @@ -1,4 +1,4 @@ -// rustfmt-remove_nested_parens: true +//@ rustfmt-remove_nested_parens: true fn main() { ((((((foo())))))); diff --git a/tests/source/configs/reorder_impl_items/false.rs b/tests/source/configs/reorder_impl_items/false.rs index beb99f0fb8e..e31c8bb6b08 100644 --- a/tests/source/configs/reorder_impl_items/false.rs +++ b/tests/source/configs/reorder_impl_items/false.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: false +//@ rustfmt-reorder_impl_items: false struct Dummy; diff --git a/tests/source/configs/reorder_impl_items/true.rs b/tests/source/configs/reorder_impl_items/true.rs index 612b1c84abd..56130a1c425 100644 --- a/tests/source/configs/reorder_impl_items/true.rs +++ b/tests/source/configs/reorder_impl_items/true.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: true +//@ rustfmt-reorder_impl_items: true struct Dummy; diff --git a/tests/source/configs/reorder_imports/false.rs b/tests/source/configs/reorder_imports/false.rs index 4b85684dc01..5554cfa98ba 100644 --- a/tests/source/configs/reorder_imports/false.rs +++ b/tests/source/configs/reorder_imports/false.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: false +//@ rustfmt-reorder_imports: false // Reorder imports use lorem; diff --git a/tests/source/configs/reorder_imports/true.rs b/tests/source/configs/reorder_imports/true.rs index 2a40f6d069f..2575f82d92a 100644 --- a/tests/source/configs/reorder_imports/true.rs +++ b/tests/source/configs/reorder_imports/true.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: true +//@ rustfmt-reorder_imports: true // Reorder imports use lorem; diff --git a/tests/source/configs/reorder_modules/false.rs b/tests/source/configs/reorder_modules/false.rs index 56b1aa03ed7..d97848d70d4 100644 --- a/tests/source/configs/reorder_modules/false.rs +++ b/tests/source/configs/reorder_modules/false.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_modules: false +//@ rustfmt-reorder_modules: false // Reorder modules mod lorem; diff --git a/tests/source/configs/reorder_modules/true.rs b/tests/source/configs/reorder_modules/true.rs index 79b0ab1e355..bed32027803 100644 --- a/tests/source/configs/reorder_modules/true.rs +++ b/tests/source/configs/reorder_modules/true.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_modules: true +//@ rustfmt-reorder_modules: true // Reorder modules mod lorem; diff --git a/tests/source/configs/short_array_element_width_threshold/10.rs b/tests/source/configs/short_array_element_width_threshold/10.rs index 7d0d70919a6..c5a5d72ae5a 100644 --- a/tests/source/configs/short_array_element_width_threshold/10.rs +++ b/tests/source/configs/short_array_element_width_threshold/10.rs @@ -1,4 +1,4 @@ -// rustfmt-short_array_element_width_threshold: 10 +//@ rustfmt-short_array_element_width_threshold: 10 fn main() { pub const FORMAT_TEST: [u64; 5] = [ diff --git a/tests/source/configs/short_array_element_width_threshold/20.rs b/tests/source/configs/short_array_element_width_threshold/20.rs index 8a93a51d6a2..7a9abf1784d 100644 --- a/tests/source/configs/short_array_element_width_threshold/20.rs +++ b/tests/source/configs/short_array_element_width_threshold/20.rs @@ -1,4 +1,4 @@ -// rustfmt-short_array_element_width_threshold: 20 +//@ rustfmt-short_array_element_width_threshold: 20 fn main() { pub const FORMAT_TEST: [u64; 5] = [ diff --git a/tests/source/configs/short_array_element_width_threshold/greater_than_max_width.rs b/tests/source/configs/short_array_element_width_threshold/greater_than_max_width.rs index 710b6fe7c4b..f730f26cec8 100644 --- a/tests/source/configs/short_array_element_width_threshold/greater_than_max_width.rs +++ b/tests/source/configs/short_array_element_width_threshold/greater_than_max_width.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 20 -// rustfmt-short_array_element_width_threshold: 30 +//@ rustfmt-max_width: 20 +//@ rustfmt-short_array_element_width_threshold: 30 fn main() { pub const FORMAT_TEST: [u64; 5] = [ diff --git a/tests/source/configs/single_line_let_else_max_width/100.rs b/tests/source/configs/single_line_let_else_max_width/100.rs index a73c9084bf2..2c32a8ef50b 100644 --- a/tests/source/configs/single_line_let_else_max_width/100.rs +++ b/tests/source/configs/single_line_let_else_max_width/100.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 100 +//@ rustfmt-single_line_let_else_max_width: 100 fn main() { let Some(a) = opt else {}; diff --git a/tests/source/configs/single_line_let_else_max_width/50.rs b/tests/source/configs/single_line_let_else_max_width/50.rs index 87d0583c552..a750f473b0f 100644 --- a/tests/source/configs/single_line_let_else_max_width/50.rs +++ b/tests/source/configs/single_line_let_else_max_width/50.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 50 +//@ rustfmt-single_line_let_else_max_width: 50 fn main() { let Some(a) = opt else {}; diff --git a/tests/source/configs/single_line_let_else_max_width/zero.rs b/tests/source/configs/single_line_let_else_max_width/zero.rs index afb9e503307..0df191f8ce0 100644 --- a/tests/source/configs/single_line_let_else_max_width/zero.rs +++ b/tests/source/configs/single_line_let_else_max_width/zero.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 0 +//@ rustfmt-single_line_let_else_max_width: 0 fn main() { let Some(a) = opt else {}; diff --git a/tests/source/configs/skip_children/true.rs b/tests/source/configs/skip_children/true.rs index e51889dd4c9..157f48f7e32 100644 --- a/tests/source/configs/skip_children/true.rs +++ b/tests/source/configs/skip_children/true.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_children: true +//@ rustfmt-skip_children: true mod foo ; mod void; diff --git a/tests/source/configs/space_before_colon/true.rs b/tests/source/configs/space_before_colon/true.rs index 0a597602528..caa7359313a 100644 --- a/tests/source/configs/space_before_colon/true.rs +++ b/tests/source/configs/space_before_colon/true.rs @@ -1,4 +1,4 @@ -// rustfmt-space_before_colon: true +//@ rustfmt-space_before_colon: true // Space before colon fn lorem(t : T) { diff --git a/tests/source/configs/spaces_around_ranges/false.rs b/tests/source/configs/spaces_around_ranges/false.rs index b478dade316..06f76acf497 100644 --- a/tests/source/configs/spaces_around_ranges/false.rs +++ b/tests/source/configs/spaces_around_ranges/false.rs @@ -1,4 +1,4 @@ -// rustfmt-spaces_around_ranges: false +//@ rustfmt-spaces_around_ranges: false // Spaces around ranges fn main() { diff --git a/tests/source/configs/spaces_around_ranges/true.rs b/tests/source/configs/spaces_around_ranges/true.rs index fe324ee3ac9..dd759ebf8e4 100644 --- a/tests/source/configs/spaces_around_ranges/true.rs +++ b/tests/source/configs/spaces_around_ranges/true.rs @@ -1,4 +1,4 @@ -// rustfmt-spaces_around_ranges: true +//@ rustfmt-spaces_around_ranges: true // Spaces around ranges fn main() { diff --git a/tests/source/configs/struct_field_align_threshold/20.rs b/tests/source/configs/struct_field_align_threshold/20.rs index 81253c46037..4e92d57e28c 100644 --- a/tests/source/configs/struct_field_align_threshold/20.rs +++ b/tests/source/configs/struct_field_align_threshold/20.rs @@ -1,7 +1,7 @@ -// rustfmt-struct_field_align_threshold: 20 -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-error_on_line_overflow: false +//@ rustfmt-struct_field_align_threshold: 20 +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-error_on_line_overflow: false struct Foo { x: u32, diff --git a/tests/source/configs/struct_lit_single_line/false.rs b/tests/source/configs/struct_lit_single_line/false.rs index 17cad8dde29..2e0eae3907c 100644 --- a/tests/source/configs/struct_lit_single_line/false.rs +++ b/tests/source/configs/struct_lit_single_line/false.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_lit_single_line: false +//@ rustfmt-struct_lit_single_line: false // Struct literal multiline-style fn main() { diff --git a/tests/source/configs/style_edition/overflow_delim_expr_2015.rs b/tests/source/configs/style_edition/overflow_delim_expr_2015.rs index 5cb4a870fc1..902cc4d4822 100644 --- a/tests/source/configs/style_edition/overflow_delim_expr_2015.rs +++ b/tests/source/configs/style_edition/overflow_delim_expr_2015.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn combine_blocklike() { do_thing( diff --git a/tests/source/configs/style_edition/overflow_delim_expr_2024.rs b/tests/source/configs/style_edition/overflow_delim_expr_2024.rs index 66c95e71aa9..9da47a0a877 100644 --- a/tests/source/configs/style_edition/overflow_delim_expr_2024.rs +++ b/tests/source/configs/style_edition/overflow_delim_expr_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn combine_blocklike() { do_thing( diff --git a/tests/source/configs/tab_spaces/2.rs b/tests/source/configs/tab_spaces/2.rs index 5c2667bc2c7..498dab07778 100644 --- a/tests/source/configs/tab_spaces/2.rs +++ b/tests/source/configs/tab_spaces/2.rs @@ -1,6 +1,6 @@ -// rustfmt-tab_spaces: 2 -// rustfmt-max_width: 30 -// rustfmt-indent_style: Block +//@ rustfmt-tab_spaces: 2 +//@ rustfmt-max_width: 30 +//@ rustfmt-indent_style: Block // Tab spaces fn lorem() { diff --git a/tests/source/configs/tab_spaces/4.rs b/tests/source/configs/tab_spaces/4.rs index da61bbd42a7..d31a9d3b6d5 100644 --- a/tests/source/configs/tab_spaces/4.rs +++ b/tests/source/configs/tab_spaces/4.rs @@ -1,6 +1,6 @@ -// rustfmt-tab_spaces: 4 -// rustfmt-max_width: 30 -// rustfmt-indent_style: Block +//@ rustfmt-tab_spaces: 4 +//@ rustfmt-max_width: 30 +//@ rustfmt-indent_style: Block // Tab spaces fn lorem() { diff --git a/tests/source/configs/trailing_comma/always.rs b/tests/source/configs/trailing_comma/always.rs index 57e874cd822..f03347f0fb7 100644 --- a/tests/source/configs/trailing_comma/always.rs +++ b/tests/source/configs/trailing_comma/always.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Always +//@ rustfmt-trailing_comma: Always // Trailing comma fn main() { diff --git a/tests/source/configs/trailing_comma/never.rs b/tests/source/configs/trailing_comma/never.rs index 4da3b996f29..6ac418f2a83 100644 --- a/tests/source/configs/trailing_comma/never.rs +++ b/tests/source/configs/trailing_comma/never.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Never +//@ rustfmt-trailing_comma: Never // Trailing comma fn main() { diff --git a/tests/source/configs/trailing_comma/vertical.rs b/tests/source/configs/trailing_comma/vertical.rs index c903e822158..ae06a344eca 100644 --- a/tests/source/configs/trailing_comma/vertical.rs +++ b/tests/source/configs/trailing_comma/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Vertical +//@ rustfmt-trailing_comma: Vertical // Trailing comma fn main() { diff --git a/tests/source/configs/type_punctuation_density/compressed.rs b/tests/source/configs/type_punctuation_density/compressed.rs index 223b9a2f0f0..2c6de7f0b08 100644 --- a/tests/source/configs/type_punctuation_density/compressed.rs +++ b/tests/source/configs/type_punctuation_density/compressed.rs @@ -1,4 +1,4 @@ -// rustfmt-type_punctuation_density: Compressed +//@ rustfmt-type_punctuation_density: Compressed // Type punctuation density fn lorem() { diff --git a/tests/source/configs/type_punctuation_density/wide.rs b/tests/source/configs/type_punctuation_density/wide.rs index fe0c0816701..da6f2423ab9 100644 --- a/tests/source/configs/type_punctuation_density/wide.rs +++ b/tests/source/configs/type_punctuation_density/wide.rs @@ -1,4 +1,4 @@ -// rustfmt-type_punctuation_density: Wide +//@ rustfmt-type_punctuation_density: Wide // Type punctuation density fn lorem() { diff --git a/tests/source/configs/use_field_init_shorthand/false.rs b/tests/source/configs/use_field_init_shorthand/false.rs index 4c2eb1de179..f62398c75ef 100644 --- a/tests/source/configs/use_field_init_shorthand/false.rs +++ b/tests/source/configs/use_field_init_shorthand/false.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: false +//@ rustfmt-use_field_init_shorthand: false // Use field initialization shorthand if possible. fn main() { diff --git a/tests/source/configs/use_field_init_shorthand/true.rs b/tests/source/configs/use_field_init_shorthand/true.rs index dcde28d74e0..7c7a588b6f5 100644 --- a/tests/source/configs/use_field_init_shorthand/true.rs +++ b/tests/source/configs/use_field_init_shorthand/true.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: true +//@ rustfmt-use_field_init_shorthand: true // Use field initialization shorthand if possible. fn main() { diff --git a/tests/source/configs/use_small_heuristics/default.rs b/tests/source/configs/use_small_heuristics/default.rs index 95238c54844..b0b24a3cb30 100644 --- a/tests/source/configs/use_small_heuristics/default.rs +++ b/tests/source/configs/use_small_heuristics/default.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Default +//@ rustfmt-use_small_heuristics: Default enum Lorem { Ipsum, diff --git a/tests/source/configs/use_small_heuristics/max.rs b/tests/source/configs/use_small_heuristics/max.rs index b79302e22ab..6bf6957d3ea 100644 --- a/tests/source/configs/use_small_heuristics/max.rs +++ b/tests/source/configs/use_small_heuristics/max.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Max +//@ rustfmt-use_small_heuristics: Max enum Lorem { Ipsum, diff --git a/tests/source/configs/use_small_heuristics/off.rs b/tests/source/configs/use_small_heuristics/off.rs index 80bcdd89896..01b337b7b47 100644 --- a/tests/source/configs/use_small_heuristics/off.rs +++ b/tests/source/configs/use_small_heuristics/off.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Off +//@ rustfmt-use_small_heuristics: Off enum Lorem { Ipsum, diff --git a/tests/source/configs/use_try_shorthand/false.rs b/tests/source/configs/use_try_shorthand/false.rs index de7f8b4a5e2..4635cbe9774 100644 --- a/tests/source/configs/use_try_shorthand/false.rs +++ b/tests/source/configs/use_try_shorthand/false.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: false +//@ rustfmt-use_try_shorthand: false // Use try! shorthand fn main() { diff --git a/tests/source/configs/use_try_shorthand/true.rs b/tests/source/configs/use_try_shorthand/true.rs index 9015ec41e5e..2fbcb91457b 100644 --- a/tests/source/configs/use_try_shorthand/true.rs +++ b/tests/source/configs/use_try_shorthand/true.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: true +//@ rustfmt-use_try_shorthand: true // Use try! shorthand fn main() { diff --git a/tests/source/configs/where_single_line/true.rs b/tests/source/configs/where_single_line/true.rs index 9de98283b5e..c760adc8563 100644 --- a/tests/source/configs/where_single_line/true.rs +++ b/tests/source/configs/where_single_line/true.rs @@ -1,4 +1,4 @@ -// rustfmt-where_single_line: true +//@ rustfmt-where_single_line: true // Where style diff --git a/tests/source/configs/wrap_comments/false.rs b/tests/source/configs/wrap_comments/false.rs index 48ecd88accb..befe46e10f5 100644 --- a/tests/source/configs/wrap_comments/false.rs +++ b/tests/source/configs/wrap_comments/false.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: false -// rustfmt-max_width: 50 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-wrap_comments: false +//@ rustfmt-max_width: 50 +//@ rustfmt-error_on_line_overflow: false // Wrap comments fn main() { diff --git a/tests/source/configs/wrap_comments/true.rs b/tests/source/configs/wrap_comments/true.rs index 39a79a4cacc..67d094e575f 100644 --- a/tests/source/configs/wrap_comments/true.rs +++ b/tests/source/configs/wrap_comments/true.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 50 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 50 // Wrap comments fn main() { diff --git a/tests/source/control-brace-style-always-next-line.rs b/tests/source/control-brace-style-always-next-line.rs index 9079fb46c0c..07aeab427ac 100644 --- a/tests/source/control-brace-style-always-next-line.rs +++ b/tests/source/control-brace-style-always-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-control_brace_style: AlwaysNextLine fn main() { loop { diff --git a/tests/source/crash-on-enum-generics/issue_6318.rs b/tests/source/crash-on-enum-generics/issue_6318.rs index 73471f3eee1..7366ba14389 100644 --- a/tests/source/crash-on-enum-generics/issue_6318.rs +++ b/tests/source/crash-on-enum-generics/issue_6318.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 fn my_fn() { enum MyEnum where diff --git a/tests/source/doc-attrib.rs b/tests/source/doc-attrib.rs index dde88c6e955..9ae52b22e72 100644 --- a/tests/source/doc-attrib.rs +++ b/tests/source/doc-attrib.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-normalize_doc_attributes: true // Only doc = "" attributes should be normalized #![doc = " Example doc attribute comment"] diff --git a/tests/source/doc-comment-with-example.rs b/tests/source/doc-comment-with-example.rs index e74ceefd195..b5b0044720b 100644 --- a/tests/source/doc-comment-with-example.rs +++ b/tests/source/doc-comment-with-example.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// Foo /// diff --git a/tests/source/doc.rs b/tests/source/doc.rs index 3b25918b12e..d3b91943309 100644 --- a/tests/source/doc.rs +++ b/tests/source/doc.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Part of multiple.rs // sadfsdfa diff --git a/tests/source/else-if-brace-style-always-next-line.rs b/tests/source/else-if-brace-style-always-next-line.rs index 7b4870fc65a..c86f19d306f 100644 --- a/tests/source/else-if-brace-style-always-next-line.rs +++ b/tests/source/else-if-brace-style-always-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-control_brace_style: AlwaysNextLine fn main() { if false diff --git a/tests/source/else-if-brace-style-closing-next-line.rs b/tests/source/else-if-brace-style-closing-next-line.rs index 3b885b3faaa..f19d6f110b1 100644 --- a/tests/source/else-if-brace-style-closing-next-line.rs +++ b/tests/source/else-if-brace-style-closing-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: ClosingNextLine +//@ rustfmt-control_brace_style: ClosingNextLine fn main() { if false diff --git a/tests/source/empty-item-single-line-false.rs b/tests/source/empty-item-single-line-false.rs index 20c5bc83b46..56c3a0b9026 100644 --- a/tests/source/empty-item-single-line-false.rs +++ b/tests/source/empty-item-single-line-false.rs @@ -1,5 +1,5 @@ -// rustfmt-brace_style: AlwaysNextLine -// rustfmt-empty_item_single_line: false +//@ rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-empty_item_single_line: false fn function() { diff --git a/tests/source/enum.rs b/tests/source/enum.rs index badf6ecc057..292b1837b1a 100644 --- a/tests/source/enum.rs +++ b/tests/source/enum.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Enums test #[atrr] diff --git a/tests/source/ergonomic_clones.rs b/tests/source/ergonomic_clones.rs index febed25b6a9..c42a27d9998 100644 --- a/tests/source/ergonomic_clones.rs +++ b/tests/source/ergonomic_clones.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(ergonomic_clones)] diff --git a/tests/source/expr-overflow-delimited.rs b/tests/source/expr-overflow-delimited.rs index cd80ca6fceb..862ca084d84 100644 --- a/tests/source/expr-overflow-delimited.rs +++ b/tests/source/expr-overflow-delimited.rs @@ -1,4 +1,4 @@ -// rustfmt-overflow_delimited_expr: true +//@ rustfmt-overflow_delimited_expr: true fn combine_blocklike() { do_thing( diff --git a/tests/source/expr.rs b/tests/source/expr.rs index 879c551ea49..e0f38c8b42e 100644 --- a/tests/source/expr.rs +++ b/tests/source/expr.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true // Test expressions fn foo() -> bool { diff --git a/tests/source/extern.rs b/tests/source/extern.rs index f51ba6e98c9..b95e3902cd0 100644 --- a/tests/source/extern.rs +++ b/tests/source/extern.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true extern crate foo ; extern crate foo as bar ; diff --git a/tests/source/extern_not_explicit.rs b/tests/source/extern_not_explicit.rs index 9d6c4c2a1cd..99e2d8094ce 100644 --- a/tests/source/extern_not_explicit.rs +++ b/tests/source/extern_not_explicit.rs @@ -1,4 +1,4 @@ -// rustfmt-force_explicit_abi: false +//@ rustfmt-force_explicit_abi: false extern "C" { fn some_fn() -> (); diff --git a/tests/source/file-lines-1.rs b/tests/source/file-lines-1.rs index 0164e30a854..f0bd5753c7e 100644 --- a/tests/source/file-lines-1.rs +++ b/tests/source/file-lines-1.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-1.rs","range":[4,8]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-1.rs","range":[4,8]}] fn floaters() { let x = Foo { diff --git a/tests/source/file-lines-2.rs b/tests/source/file-lines-2.rs index 6f44ec6e69d..3b59ec2763e 100644 --- a/tests/source/file-lines-2.rs +++ b/tests/source/file-lines-2.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-2.rs","range":[10,15]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-2.rs","range":[10,15]}] fn floaters() { let x = Foo { diff --git a/tests/source/file-lines-3.rs b/tests/source/file-lines-3.rs index 4b825b9f58c..ce557d8a07f 100644 --- a/tests/source/file-lines-3.rs +++ b/tests/source/file-lines-3.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-3.rs","range":[4,8]},{"file":"tests/source/file-lines-3.rs","range":[10,15]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-3.rs","range":[4,8]},{"file":"tests/source/file-lines-3.rs","range":[10,15]}] fn floaters() { let x = Foo { diff --git a/tests/source/file-lines-4.rs b/tests/source/file-lines-4.rs index 83928bf6fec..98295ebd970 100644 --- a/tests/source/file-lines-4.rs +++ b/tests/source/file-lines-4.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // (Test that nothing is formatted if an empty array is specified.) fn floaters() { diff --git a/tests/source/file-lines-5.rs b/tests/source/file-lines-5.rs index 8ec2c67bc44..4224aa885c8 100644 --- a/tests/source/file-lines-5.rs +++ b/tests/source/file-lines-5.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-5.rs","range":[3,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-5.rs","range":[3,5]}] struct A { t: i64, diff --git a/tests/source/file-lines-6.rs b/tests/source/file-lines-6.rs index 2eacc8a0e75..e8420f8ab30 100644 --- a/tests/source/file-lines-6.rs +++ b/tests/source/file-lines-6.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-6.rs","range":[9,10]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-6.rs","range":[9,10]}] struct A { t: i64, diff --git a/tests/source/file-lines-7.rs b/tests/source/file-lines-7.rs index b227ac35dcc..cd9b71f199b 100644 --- a/tests/source/file-lines-7.rs +++ b/tests/source/file-lines-7.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-7.rs","range":[8,15]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-7.rs","range":[8,15]}] struct A { t: i64, diff --git a/tests/source/file-lines-item.rs b/tests/source/file-lines-item.rs index fe52a7fa176..89f18221ee7 100644 --- a/tests/source/file-lines-item.rs +++ b/tests/source/file-lines-item.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-item.rs","range":[6,8]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-item.rs","range":[6,8]}] use foo::{c, b, a}; use bar; diff --git a/tests/source/fn-custom-6.rs b/tests/source/fn-custom-6.rs index 807084575fa..f6d29ce355e 100644 --- a/tests/source/fn-custom-6.rs +++ b/tests/source/fn-custom-6.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Test different indents. fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { diff --git a/tests/source/fn-custom-7.rs b/tests/source/fn-custom-7.rs index 3ecd8701727..63cbf4ed476 100644 --- a/tests/source/fn-custom-7.rs +++ b/tests/source/fn-custom-7.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-fn_params_layout: Vertical -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-normalize_comments: true +//@ rustfmt-fn_params_layout: Vertical +//@ rustfmt-brace_style: AlwaysNextLine // Case with only one variable. fn foo(a: u8) -> u8 { diff --git a/tests/source/fn-custom-8.rs b/tests/source/fn-custom-8.rs index 0dd64868b2d..2c40fafc0b9 100644 --- a/tests/source/fn-custom-8.rs +++ b/tests/source/fn-custom-8.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Test different indents. fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { diff --git a/tests/source/fn-custom.rs b/tests/source/fn-custom.rs index 64ef0ecfaae..4fcf6b0883a 100644 --- a/tests/source/fn-custom.rs +++ b/tests/source/fn-custom.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Compressed +//@ rustfmt-fn_params_layout: Compressed // Test some of the ways function signatures can be customised. // Test compressed layout of args. diff --git a/tests/source/fn-simple.rs b/tests/source/fn-simple.rs index 12a50c013a9..fb256cccf23 100644 --- a/tests/source/fn-simple.rs +++ b/tests/source/fn-simple.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn simple(/*pre-comment on a function!?*/ i: i32/*yes, it's possible! */ ,response: NoWay /* hose */) { diff --git a/tests/source/fn-single-line/version_one.rs b/tests/source/fn-single-line/version_one.rs index 85957e3fdcc..8eb2e13adfd 100644 --- a/tests/source/fn-single-line/version_one.rs +++ b/tests/source/fn-single-line/version_one.rs @@ -1,5 +1,5 @@ -// rustfmt-fn_single_line: true -// rustfmt-style_edition: 2015 +//@ rustfmt-fn_single_line: true +//@ rustfmt-style_edition: 2015 // Test single-line functions. fn foo_expr() { diff --git a/tests/source/fn-single-line/version_two.rs b/tests/source/fn-single-line/version_two.rs index f119e581217..9f9bdc80489 100644 --- a/tests/source/fn-single-line/version_two.rs +++ b/tests/source/fn-single-line/version_two.rs @@ -1,5 +1,5 @@ -// rustfmt-fn_single_line: true -// rustfmt-style_edition: 2024 +//@ rustfmt-fn_single_line: true +//@ rustfmt-style_edition: 2024 // Test single-line functions. fn foo_expr() { diff --git a/tests/source/fn_args_indent-block.rs b/tests/source/fn_args_indent-block.rs index 955f390cca2..0774378b536 100644 --- a/tests/source/fn_args_indent-block.rs +++ b/tests/source/fn_args_indent-block.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn foo() { foo(); diff --git a/tests/source/fn_args_layout-vertical.rs b/tests/source/fn_args_layout-vertical.rs index fd6e3f0442e..5360a3cfa5d 100644 --- a/tests/source/fn_args_layout-vertical.rs +++ b/tests/source/fn_args_layout-vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Vertical +//@ rustfmt-fn_params_layout: Vertical // Empty list should stay on one line. fn do_bar( diff --git a/tests/source/hard-tabs.rs b/tests/source/hard-tabs.rs index e4a0f417007..317bddd9aba 100644 --- a/tests/source/hard-tabs.rs +++ b/tests/source/hard-tabs.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-hard_tabs: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-hard_tabs: true fn main() { let x = Bar; diff --git a/tests/source/hello.rs b/tests/source/hello.rs index f892e6debb1..2be12faa8f9 100644 --- a/tests/source/hello.rs +++ b/tests/source/hello.rs @@ -1,5 +1,5 @@ -// rustfmt-config: small_tabs.toml -// rustfmt-target: hello.rs +//@ rustfmt-config: small_tabs.toml +//@ rustfmt-target: hello.rs // Smoke test - hello world. diff --git a/tests/source/hello2.rs b/tests/source/hello2.rs index 48af7de3887..c794512b2fd 100644 --- a/tests/source/hello2.rs +++ b/tests/source/hello2.rs @@ -1,5 +1,5 @@ -// rustfmt-config: small_tabs.toml -// rustfmt-target: hello.rs +//@ rustfmt-config: small_tabs.toml +//@ rustfmt-target: hello.rs // Smoke test - hello world. diff --git a/tests/source/impls.rs b/tests/source/impls.rs index 8baa704ab50..9e831fd5410 100644 --- a/tests/source/impls.rs +++ b/tests/source/impls.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true impl Foo for Bar { fn foo() { "hi" } } pub impl Foo for Bar { diff --git a/tests/source/imports/imports-reorder.rs b/tests/source/imports/imports-reorder.rs index cbe9d6ca78a..325cc0d43ca 100644 --- a/tests/source/imports/imports-reorder.rs +++ b/tests/source/imports/imports-reorder.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true use path::{C,/*A*/ A, B /* B */, self /* self */}; diff --git a/tests/source/imports/imports.rs b/tests/source/imports/imports.rs index 4dfc6ed94e3..b3dbc018e6b 100644 --- a/tests/source/imports/imports.rs +++ b/tests/source/imports/imports.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Imports. diff --git a/tests/source/imports/imports_granularity_crate.rs b/tests/source/imports/imports_granularity_crate.rs index f6f7761e82e..66403379d84 100644 --- a/tests/source/imports/imports_granularity_crate.rs +++ b/tests/source/imports/imports_granularity_crate.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Crate +//@ rustfmt-imports_granularity: Crate use a::{c,d,b}; use a::{d, e, b, a, f}; diff --git a/tests/source/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs b/tests/source/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs index e23705a884f..496a2af6cf4 100644 --- a/tests/source/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs +++ b/tests/source/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs @@ -1,6 +1,6 @@ -// rustfmt-imports_granularity: Item -// rustfmt-reorder_imports: false -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-imports_granularity: Item +//@ rustfmt-reorder_imports: false +//@ rustfmt-group_imports: StdExternalCrate use crate::lexer; use crate::lexer; diff --git a/tests/source/imports/imports_granularity_item-with-dups.rs b/tests/source/imports/imports_granularity_item-with-dups.rs index 3e9589c299f..43a89a03a63 100644 --- a/tests/source/imports/imports_granularity_item-with-dups.rs +++ b/tests/source/imports/imports_granularity_item-with-dups.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Item +//@ rustfmt-imports_granularity: Item use crate::lexer; use crate::lexer; diff --git a/tests/source/imports/imports_granularity_item.rs b/tests/source/imports/imports_granularity_item.rs index b82c0d33caf..c97bfb2cbb7 100644 --- a/tests/source/imports/imports_granularity_item.rs +++ b/tests/source/imports/imports_granularity_item.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Item +//@ rustfmt-imports_granularity: Item use a::{b, c, d}; use a::{f::g, h::{i, j}}; diff --git a/tests/source/imports/imports_granularity_module.rs b/tests/source/imports/imports_granularity_module.rs index 643f2b9fa01..00d1e101f6b 100644 --- a/tests/source/imports/imports_granularity_module.rs +++ b/tests/source/imports/imports_granularity_module.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Module +//@ rustfmt-imports_granularity: Module use a::{b::c, d::e}; use a::{f, g::{h, i}}; diff --git a/tests/source/imports/imports_granularity_one.rs b/tests/source/imports/imports_granularity_one.rs index 4d5a4795641..0686e04b252 100644 --- a/tests/source/imports/imports_granularity_one.rs +++ b/tests/source/imports/imports_granularity_one.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: One +//@ rustfmt-imports_granularity: One use b; use a::ac::{aca, acb}; diff --git a/tests/source/imports_raw_identifiers/version_One.rs b/tests/source/imports_raw_identifiers/version_One.rs index bc4b5b13569..852f6b3facd 100644 --- a/tests/source/imports_raw_identifiers/version_One.rs +++ b/tests/source/imports_raw_identifiers/version_One.rs @@ -1,4 +1,4 @@ -// rustfmt-version:One +//@ rustfmt-version:One use websocket::client::ClientBuilder; use websocket::r#async::futures::Stream; diff --git a/tests/source/imports_raw_identifiers/version_Two.rs b/tests/source/imports_raw_identifiers/version_Two.rs index 88e7fbd01ca..a7e582ff48a 100644 --- a/tests/source/imports_raw_identifiers/version_Two.rs +++ b/tests/source/imports_raw_identifiers/version_Two.rs @@ -1,4 +1,4 @@ -// rustfmt-version:Two +//@ rustfmt-version:Two use websocket::client::ClientBuilder; use websocket::r#async::futures::Stream; diff --git a/tests/source/invalid-rust-code-in-doc-comment.rs b/tests/source/invalid-rust-code-in-doc-comment.rs index 835b0261b76..2b96407ae95 100644 --- a/tests/source/invalid-rust-code-in-doc-comment.rs +++ b/tests/source/invalid-rust-code-in-doc-comment.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// ```rust /// if (true) { … } diff --git a/tests/source/issue-1021.rs b/tests/source/issue-1021.rs index 380e24cc0b0..c36bed9a2e5 100644 --- a/tests/source/issue-1021.rs +++ b/tests/source/issue-1021.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { match x { S(true , .., true ) => (), diff --git a/tests/source/issue-1120.rs b/tests/source/issue-1120.rs index e85c9af99d4..3f5d2af257b 100644 --- a/tests/source/issue-1120.rs +++ b/tests/source/issue-1120.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: true +//@ rustfmt-reorder_imports: true // Ensure that a use at the start of an inline module is correctly formatted. mod foo {use bar;} diff --git a/tests/source/issue-1124.rs b/tests/source/issue-1124.rs index 35c2197fa34..fc1516a96d5 100644 --- a/tests/source/issue-1124.rs +++ b/tests/source/issue-1124.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: true +//@ rustfmt-reorder_imports: true use d; use c; use b; use a; // The previous line has a space after the `use a;` diff --git a/tests/source/issue-1127.rs b/tests/source/issue-1127.rs index b49db4e3f65..d8ba1bca755 100644 --- a/tests/source/issue-1127.rs +++ b/tests/source/issue-1127.rs @@ -1,6 +1,6 @@ -// rustfmt-max_width: 120 -// rustfmt-match_arm_blocks: false -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-max_width: 120 +//@ rustfmt-match_arm_blocks: false +//@ rustfmt-match_block_trailing_comma: true fn a_very_very_very_very_very_very_very_very_very_very_very_long_function_name() -> i32 { 42 diff --git a/tests/source/issue-1177.rs b/tests/source/issue-1177.rs index 3ac423c5aef..3cce4b4cc02 100644 --- a/tests/source/issue-1177.rs +++ b/tests/source/issue-1177.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { // Line Comment /* Block Comment */ diff --git a/tests/source/issue-1210/a.rs b/tests/source/issue-1210/a.rs index 6bb9964b4e3..28b513ffd0a 100644 --- a/tests/source/issue-1210/a.rs +++ b/tests/source/issue-1210/a.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 impl Foo { fn cxx(&self, target: &str) -> &Path { diff --git a/tests/source/issue-1210/b.rs b/tests/source/issue-1210/b.rs index 8c71ef98b7f..2eacc0eeea1 100644 --- a/tests/source/issue-1210/b.rs +++ b/tests/source/issue-1210/b.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 impl Foo { fn cxx(&self, target: &str) -> &Path { diff --git a/tests/source/issue-1210/c.rs b/tests/source/issue-1210/c.rs index c080cef950b..af23a20ce32 100644 --- a/tests/source/issue-1210/c.rs +++ b/tests/source/issue-1210/c.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 const foo: String = "trailing_spaces!! keep them! Amet neque. Praesent rhoncus eros non velit."; diff --git a/tests/source/issue-1210/d.rs b/tests/source/issue-1210/d.rs index 783736bc3b2..92b7da05e80 100644 --- a/tests/source/issue-1210/d.rs +++ b/tests/source/issue-1210/d.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // trailing_spaces_in_comment!! // remove those from above diff --git a/tests/source/issue-1210/e.rs b/tests/source/issue-1210/e.rs index 9abada1d6d8..0f31731984a 100644 --- a/tests/source/issue-1210/e.rs +++ b/tests/source/issue-1210/e.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 // explicit line breaks should be kept in order to preserve the layout diff --git a/tests/source/issue-1216.rs b/tests/source/issue-1216.rs index d727c158ab8..896df187767 100644 --- a/tests/source/issue-1216.rs +++ b/tests/source/issue-1216.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true enum E { A, //* I am not a block comment (caused panic) B, diff --git a/tests/source/issue-1278.rs b/tests/source/issue-1278.rs index b7e636f1a27..bff29d14045 100644 --- a/tests/source/issue-1278.rs +++ b/tests/source/issue-1278.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block #![feature(pub_restricted)] diff --git a/tests/source/issue-1350.rs b/tests/source/issue-1350.rs index 1baa1985a7e..0bece7c2d4c 100644 --- a/tests/source/issue-1350.rs +++ b/tests/source/issue-1350.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 120 -// rustfmt-comment_width: 110 +//@ rustfmt-max_width: 120 +//@ rustfmt-comment_width: 110 impl Struct { fn fun() { diff --git a/tests/source/issue-1914.rs b/tests/source/issue-1914.rs index 447296c4b87..5af465b7422 100644 --- a/tests/source/issue-1914.rs +++ b/tests/source/issue-1914.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 extern "C" { #[link_name = "_ZN7MyClass26example_check_no_collisionE"] diff --git a/tests/source/issue-2179/one.rs b/tests/source/issue-2179/one.rs index 8bbd56f0521..16f106d58b4 100644 --- a/tests/source/issue-2179/one.rs +++ b/tests/source/issue-2179/one.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2015 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-style_edition: 2015 +//@ rustfmt-error_on_line_overflow: false fn issue_2179() { let (opts, rustflags, clear_env_rust_log) = diff --git a/tests/source/issue-2179/two.rs b/tests/source/issue-2179/two.rs index 631b0f3c86e..61d964991e4 100644 --- a/tests/source/issue-2179/two.rs +++ b/tests/source/issue-2179/two.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-style_edition: 2024 +//@ rustfmt-error_on_line_overflow: false fn issue_2179() { let (opts, rustflags, clear_env_rust_log) = diff --git a/tests/source/issue-2342.rs b/tests/source/issue-2342.rs index f86d24a146b..f967cfc310e 100644 --- a/tests/source/issue-2342.rs +++ b/tests/source/issue-2342.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 struct Foo { #[cfg(feature = "serde")] bytes: [[u8; 17]; 5], // Same size as signature::ED25519_PKCS8_V2_LEN diff --git a/tests/source/issue-2482/a.rs b/tests/source/issue-2482/a.rs index fbbcb52a878..f0b3ab82a02 100644 --- a/tests/source/issue-2482/a.rs +++ b/tests/source/issue-2482/a.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_modules: true +//@ rustfmt-reorder_modules: true // Do not reorder inline modules. diff --git a/tests/source/issue-2496.rs b/tests/source/issue-2496.rs index 0ebd4b510ec..abaa86e44fa 100644 --- a/tests/source/issue-2496.rs +++ b/tests/source/issue-2496.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { match option { None => some_function(first_reasonably_long_argument, diff --git a/tests/source/issue-2520.rs b/tests/source/issue-2520.rs index 5a23f10430d..d81fb963e72 100644 --- a/tests/source/issue-2520.rs +++ b/tests/source/issue-2520.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_code_in_doc_comments: true //! ```rust //! println!( "hello, world" ); diff --git a/tests/source/issue-2523.rs b/tests/source/issue-2523.rs index 491d5c38fc2..39c11c43166 100644 --- a/tests/source/issue-2523.rs +++ b/tests/source/issue-2523.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_code_in_doc_comments: true // Do not unindent macro calls in comment with unformattable syntax. //! ```rust diff --git a/tests/source/issue-2644.rs b/tests/source/issue-2644.rs index fa9d16f444d..10efdc36142 100644 --- a/tests/source/issue-2644.rs +++ b/tests/source/issue-2644.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 fn foo(e: Enum) { match e { Enum::Var { diff --git a/tests/source/issue-2728.rs b/tests/source/issue-2728.rs index 6cb41b75b6d..24d9af4fd34 100644 --- a/tests/source/issue-2728.rs +++ b/tests/source/issue-2728.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-newline_style: Windows +//@ rustfmt-wrap_comments: true +//@ rustfmt-newline_style: Windows //! ```rust //! extern crate uom; diff --git a/tests/source/issue-2794.rs b/tests/source/issue-2794.rs index c3f9c0412a4..209c7690949 100644 --- a/tests/source/issue-2794.rs +++ b/tests/source/issue-2794.rs @@ -1,6 +1,6 @@ -// rustfmt-indent_style: Block -// rustfmt-imports_indent: Block -// rustfmt-imports_layout: Vertical +//@ rustfmt-indent_style: Block +//@ rustfmt-imports_indent: Block +//@ rustfmt-imports_layout: Vertical use std::{ env, fs, io::{Read, Write}, diff --git a/tests/source/issue-2835.rs b/tests/source/issue-2835.rs index 2219b0b38e4..4f08b4da90d 100644 --- a/tests/source/issue-2835.rs +++ b/tests/source/issue-2835.rs @@ -1,5 +1,5 @@ -// rustfmt-brace_style: AlwaysNextLine -// rustfmt-fn_single_line: true +//@ rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-fn_single_line: true fn lorem() -> i32 { diff --git a/tests/source/issue-2863.rs b/tests/source/issue-2863.rs index 1bda857be76..5d06d196b8b 100644 --- a/tests/source/issue-2863.rs +++ b/tests/source/issue-2863.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: true +//@ rustfmt-reorder_impl_items: true impl IntoIterator for SafeVec { type F = impl Trait; diff --git a/tests/source/issue-2869.rs b/tests/source/issue-2869.rs index d18adfb462e..2405e3f59db 100644 --- a/tests/source/issue-2869.rs +++ b/tests/source/issue-2869.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 50 +//@ rustfmt-struct_field_align_threshold: 50 #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "PascalCase")] diff --git a/tests/source/issue-2917/packed_simd.rs b/tests/source/issue-2917/packed_simd.rs index afa9e67c8ab..84fd4bd6d24 100644 --- a/tests/source/issue-2917/packed_simd.rs +++ b/tests/source/issue-2917/packed_simd.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! Implements `From` and `Into` for vector types. macro_rules! impl_from_vector { diff --git a/tests/source/issue-2922.rs b/tests/source/issue-2922.rs index 44fae0b645d..c2dff037e3e 100644 --- a/tests/source/issue-2922.rs +++ b/tests/source/issue-2922.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual struct Functions { RunListenServer: unsafe extern "C" fn(*mut c_void, *mut c_char, diff --git a/tests/source/issue-2927-2.rs b/tests/source/issue-2927-2.rs index 07afef38cf5..033d0216605 100644 --- a/tests/source/issue-2927-2.rs +++ b/tests/source/issue-2927-2.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2015 +//@ rustfmt-edition: 2015 #![feature(uniform_paths)] use futures::prelude::*; use http_03::cli::Cli; diff --git a/tests/source/issue-2927.rs b/tests/source/issue-2927.rs index c7ec7bb0855..060e2201b7c 100644 --- a/tests/source/issue-2927.rs +++ b/tests/source/issue-2927.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(uniform_paths)] use futures::prelude::*; use http_03::cli::Cli; diff --git a/tests/source/issue-2930.rs b/tests/source/issue-2930.rs index 962c3e4fe04..b6bc67dd7e1 100644 --- a/tests/source/issue-2930.rs +++ b/tests/source/issue-2930.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { let (first_variable, second_variable) = (this_is_something_with_an_extraordinarily_long_name, this_variable_name_is_also_pretty_long); diff --git a/tests/source/issue-2955.rs b/tests/source/issue-2955.rs index 525e070a57e..9632a81d1e9 100644 --- a/tests/source/issue-2955.rs +++ b/tests/source/issue-2955.rs @@ -1,4 +1,4 @@ -// rustfmt-condense_wildcard_suffixes: true +//@ rustfmt-condense_wildcard_suffixes: true fn main() { match (1, 2, 3) { (_, _, _) => (), diff --git a/tests/source/issue-2985.rs b/tests/source/issue-2985.rs index bde4da8314c..cc9e3d44fe5 100644 --- a/tests/source/issue-2985.rs +++ b/tests/source/issue-2985.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn foo() { { { diff --git a/tests/source/issue-3049.rs b/tests/source/issue-3049.rs index 43742683e4c..9d4ea168f1d 100644 --- a/tests/source/issue-3049.rs +++ b/tests/source/issue-3049.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { something.aaaaaaaaaaaa() .aaaaaaaaaaaa() diff --git a/tests/source/issue-3055/original.rs b/tests/source/issue-3055/original.rs index 45e58473a4a..9bda57fd79b 100644 --- a/tests/source/issue-3055/original.rs +++ b/tests/source/issue-3055/original.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc commodo ultricies dui. /// diff --git a/tests/source/issue-3059.rs b/tests/source/issue-3059.rs index 49a75cd67ab..843052d2100 100644 --- a/tests/source/issue-3059.rs +++ b/tests/source/issue-3059.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 80 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 80 /// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc commodo ultricies dui. /// Cras gravida rutrum massa. Donec accumsan mattis turpis. Quisque sem. Quisque elementum sapien diff --git a/tests/source/issue-3066.rs b/tests/source/issue-3066.rs index 4d1ece43def..dc801581503 100644 --- a/tests/source/issue-3066.rs +++ b/tests/source/issue-3066.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { Struct { field: aaaaaaaaaaa }; Struct { field: aaaaaaaaaaaa, }; diff --git a/tests/source/issue-3153.rs b/tests/source/issue-3153.rs index 2836ce97cf8..ccaa8615d02 100644 --- a/tests/source/issue-3153.rs +++ b/tests/source/issue-3153.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// This may panic if: /// - there are fewer than `max_header_bytes` bytes preceding the body diff --git a/tests/source/issue-3158.rs b/tests/source/issue-3158.rs index 315073db6af..c531e55a1cd 100644 --- a/tests/source/issue-3158.rs +++ b/tests/source/issue-3158.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// Should format /// ```rust diff --git a/tests/source/issue-3213/version_one.rs b/tests/source/issue-3213/version_one.rs index ed7d5145150..d16cdb83eb7 100644 --- a/tests/source/issue-3213/version_one.rs +++ b/tests/source/issue-3213/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn foo() { match 0 { diff --git a/tests/source/issue-3213/version_two.rs b/tests/source/issue-3213/version_two.rs index c6d04aced8d..35e4bf9d366 100644 --- a/tests/source/issue-3213/version_two.rs +++ b/tests/source/issue-3213/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn foo() { match 0 { diff --git a/tests/source/issue-3227/two.rs b/tests/source/issue-3227/two.rs index 50c0ad47dc1..60f82671730 100644 --- a/tests/source/issue-3227/two.rs +++ b/tests/source/issue-3227/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { thread::spawn(|| { diff --git a/tests/source/issue-3241.rs b/tests/source/issue-3241.rs index 090284a21fd..fd93c0fec43 100644 --- a/tests/source/issue-3241.rs +++ b/tests/source/issue-3241.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 use ::ignore; use ::ignore::some::more; diff --git a/tests/source/issue-3265.rs b/tests/source/issue-3265.rs index e927cf2be46..142ddd5b13c 100644 --- a/tests/source/issue-3265.rs +++ b/tests/source/issue-3265.rs @@ -1,4 +1,4 @@ -// rustfmt-newline_style: Windows +//@ rustfmt-newline_style: Windows #[cfg(test)] mod test { summary_test! { diff --git a/tests/source/issue-3270/one.rs b/tests/source/issue-3270/one.rs index 64861176b91..aaa2807787b 100644 --- a/tests/source/issue-3270/one.rs +++ b/tests/source/issue-3270/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 pub fn main() { /* let s = String::from( diff --git a/tests/source/issue-3270/two.rs b/tests/source/issue-3270/two.rs index 1342cf03c39..4471d2e6a2b 100644 --- a/tests/source/issue-3270/two.rs +++ b/tests/source/issue-3270/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub fn main() { /* let s = String::from( diff --git a/tests/source/issue-3272/v1.rs b/tests/source/issue-3272/v1.rs index 56dc048bf8a..097ff313195 100644 --- a/tests/source/issue-3272/v1.rs +++ b/tests/source/issue-3272/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn main() { assert!(HAYSTACK diff --git a/tests/source/issue-3272/v2.rs b/tests/source/issue-3272/v2.rs index f3adbe37c76..b5d6260039c 100644 --- a/tests/source/issue-3272/v2.rs +++ b/tests/source/issue-3272/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { assert!(HAYSTACK diff --git a/tests/source/issue-3278/version_one.rs b/tests/source/issue-3278/version_one.rs index 718a32b4c7e..978234326c8 100644 --- a/tests/source/issue-3278/version_one.rs +++ b/tests/source/issue-3278/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 pub fn parse_conditional<'a, I: 'a>( ) -> impl Parser + 'a diff --git a/tests/source/issue-3278/version_two.rs b/tests/source/issue-3278/version_two.rs index eb605e509f9..a0ed3ede1fe 100644 --- a/tests/source/issue-3278/version_two.rs +++ b/tests/source/issue-3278/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub fn parse_conditional<'a, I: 'a>() -> impl Parser + 'a diff --git a/tests/source/issue-3295/two.rs b/tests/source/issue-3295/two.rs index ae3d2ec28c0..f64798ded27 100644 --- a/tests/source/issue-3295/two.rs +++ b/tests/source/issue-3295/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub enum TestEnum { a, b, diff --git a/tests/source/issue-3302.rs b/tests/source/issue-3302.rs index 5e0862cb399..4371d88f24c 100644 --- a/tests/source/issue-3302.rs +++ b/tests/source/issue-3302.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 macro_rules! moo1 { () => { diff --git a/tests/source/issue-3343.rs b/tests/source/issue-3343.rs index 5670b04f5d6..a2ae29c1105 100644 --- a/tests/source/issue-3343.rs +++ b/tests/source/issue-3343.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 50 +//@ rustfmt-inline_attribute_width: 50 #[cfg(feature = "alloc")] use core::slice; diff --git a/tests/source/issue-3494/crlf.rs b/tests/source/issue-3494/crlf.rs index 9ce457c7b06..92c99bc0a51 100644 --- a/tests/source/issue-3494/crlf.rs +++ b/tests/source/issue-3494/crlf.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-3494/crlf.rs","range":[4,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-3494/crlf.rs","range":[4,5]}] pub fn main() { diff --git a/tests/source/issue-3494/lf.rs b/tests/source/issue-3494/lf.rs index bdbe69cef4a..f77e181ab50 100644 --- a/tests/source/issue-3494/lf.rs +++ b/tests/source/issue-3494/lf.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-3494/lf.rs","range":[4,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-3494/lf.rs","range":[4,5]}] pub fn main() { diff --git a/tests/source/issue-3515.rs b/tests/source/issue-3515.rs index 9f760cb94e8..6140a07ccd6 100644 --- a/tests/source/issue-3515.rs +++ b/tests/source/issue-3515.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: false +//@ rustfmt-reorder_imports: false use std :: fmt :: { self , Display } ; use std :: collections :: HashMap ; diff --git a/tests/source/issue-3585/extern_crate.rs b/tests/source/issue-3585/extern_crate.rs index 6716983ba0f..ba4e01713ab 100644 --- a/tests/source/issue-3585/extern_crate.rs +++ b/tests/source/issue-3585/extern_crate.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 100 +//@ rustfmt-inline_attribute_width: 100 #[macro_use] extern crate static_assertions; diff --git a/tests/source/issue-3585/reorder_imports_disabled.rs b/tests/source/issue-3585/reorder_imports_disabled.rs index 45b1bb9fdd9..26417244203 100644 --- a/tests/source/issue-3585/reorder_imports_disabled.rs +++ b/tests/source/issue-3585/reorder_imports_disabled.rs @@ -1,5 +1,5 @@ -// rustfmt-inline_attribute_width: 100 -// rustfmt-reorder_imports: false +//@ rustfmt-inline_attribute_width: 100 +//@ rustfmt-reorder_imports: false #[cfg(unix)] extern crate crateb; diff --git a/tests/source/issue-3585/reorder_imports_enabled.rs b/tests/source/issue-3585/reorder_imports_enabled.rs index 9f433e5ca21..964f9432d29 100644 --- a/tests/source/issue-3585/reorder_imports_enabled.rs +++ b/tests/source/issue-3585/reorder_imports_enabled.rs @@ -1,5 +1,5 @@ -// rustfmt-inline_attribute_width: 100 -// rustfmt-reorder_imports: true +//@ rustfmt-inline_attribute_width: 100 +//@ rustfmt-reorder_imports: true #[cfg(unix)] extern crate crateb; diff --git a/tests/source/issue-3585/use.rs b/tests/source/issue-3585/use.rs index e71ba9008ce..efd596d6160 100644 --- a/tests/source/issue-3585/use.rs +++ b/tests/source/issue-3585/use.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 100 +//@ rustfmt-inline_attribute_width: 100 #[macro_use] use static_assertions; diff --git a/tests/source/issue-3636.rs b/tests/source/issue-3636.rs index edfa03012f2..838ab5c09c9 100644 --- a/tests/source/issue-3636.rs +++ b/tests/source/issue-3636.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-3636.rs","range":[4,7]},{"file":"tests/target/issue-3636.rs","range":[3,6]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-3636.rs","range":[4,7]},{"file":"tests/target/issue-3636.rs","range":[3,6]}] fn foo() { let x = diff --git a/tests/source/issue-3701/one.rs b/tests/source/issue-3701/one.rs index 4e8518b6f18..c3bc63a92ed 100644 --- a/tests/source/issue-3701/one.rs +++ b/tests/source/issue-3701/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/source/issue-3701/two.rs b/tests/source/issue-3701/two.rs index d7cb790a754..8be3ef1f4c2 100644 --- a/tests/source/issue-3701/two.rs +++ b/tests/source/issue-3701/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/source/issue-3709.rs b/tests/source/issue-3709.rs index 73c2a624e52..be96fc7b4c1 100644 --- a/tests/source/issue-3709.rs +++ b/tests/source/issue-3709.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 macro_rules! token { ($t:tt) => {}; diff --git a/tests/source/issue-3750.rs b/tests/source/issue-3750.rs index 1189a99d2b6..2439fb95cee 100644 --- a/tests/source/issue-3750.rs +++ b/tests/source/issue-3750.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Crate +//@ rustfmt-imports_granularity: Crate pub mod foo { pub mod bar { diff --git a/tests/source/issue-3751.rs b/tests/source/issue-3751.rs index 1343f80e66e..213c3d97590 100644 --- a/tests/source/issue-3751.rs +++ b/tests/source/issue-3751.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true //! Empty pound line //! diff --git a/tests/source/issue-3779/lib.rs b/tests/source/issue-3779/lib.rs index 16e9d48337b..02bf9c2275b 100644 --- a/tests/source/issue-3779/lib.rs +++ b/tests/source/issue-3779/lib.rs @@ -1,5 +1,5 @@ -// rustfmt-unstable: true -// rustfmt-config: issue-3779.toml +//@ rustfmt-unstable: true +//@ rustfmt-config: issue-3779.toml #[path = "ice.rs"] mod ice; diff --git a/tests/source/issue-3787.rs b/tests/source/issue-3787.rs index bcdc131a05e..7e5c4e6ab1b 100644 --- a/tests/source/issue-3787.rs +++ b/tests/source/issue-3787.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! URLs in items //! * [This is a link with a very loooooooooooooooooooooooooooooooooooooooooong URL.](https://example.com/This/is/a/link/with/a/very/loooooooooooooooooooooooooooooooooooooooooong/URL) diff --git a/tests/source/issue-3805.rs b/tests/source/issue-3805.rs index aadc4a9dddc..62441820083 100644 --- a/tests/source/issue-3805.rs +++ b/tests/source/issue-3805.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-format_macro_matchers: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-format_macro_matchers: true // From original issue example - Line length 101 macro_rules! test { diff --git a/tests/source/issue-3840/version-one_hard-tabs.rs b/tests/source/issue-3840/version-one_hard-tabs.rs index bf7ea7da0eb..ad0901e8575 100644 --- a/tests/source/issue-3840/version-one_hard-tabs.rs +++ b/tests/source/issue-3840/version-one_hard-tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true impl + FromEvent, A: Widget2, B: Widget2, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter { diff --git a/tests/source/issue-3840/version-two_hard-tabs.rs b/tests/source/issue-3840/version-two_hard-tabs.rs index 8d009eabdec..4ddb10ae86f 100644 --- a/tests/source/issue-3840/version-two_hard-tabs.rs +++ b/tests/source/issue-3840/version-two_hard-tabs.rs @@ -1,5 +1,5 @@ -// rustfmt-hard_tabs: true -// rustfmt-style_edition: 2024 +//@ rustfmt-hard_tabs: true +//@ rustfmt-style_edition: 2024 impl + FromEvent, A: Widget2, B: Widget2, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter { diff --git a/tests/source/issue-3840/version-two_soft-tabs.rs b/tests/source/issue-3840/version-two_soft-tabs.rs index 9e283d3be0a..be932416fbe 100644 --- a/tests/source/issue-3840/version-two_soft-tabs.rs +++ b/tests/source/issue-3840/version-two_soft-tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 impl + FromEvent, A: Widget2, B: Widget2, C: for<'a> CtxFamily<'a>> Widget2 for WidgetEventLifter { diff --git a/tests/source/issue-3987/format_macro_bodies_true.rs b/tests/source/issue-3987/format_macro_bodies_true.rs index 9af114fbe57..1b7b4c014c5 100644 --- a/tests/source/issue-3987/format_macro_bodies_true.rs +++ b/tests/source/issue-3987/format_macro_bodies_true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: true +//@ rustfmt-format_macro_bodies: true // with comments macro_rules! macros { diff --git a/tests/source/issue-4036/one.rs b/tests/source/issue-4036/one.rs index 9f9675f5163..1aa52d8a63d 100644 --- a/tests/source/issue-4036/one.rs +++ b/tests/source/issue-4036/one.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true macro_rules! test { () => { diff --git a/tests/source/issue-4036/three.rs b/tests/source/issue-4036/three.rs index e1865dd0868..9f7d011d3f7 100644 --- a/tests/source/issue-4036/three.rs +++ b/tests/source/issue-4036/three.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-hard_tabs: true +//@ rustfmt-format_strings: true +//@ rustfmt-hard_tabs: true macro_rules! test { () => { diff --git a/tests/source/issue-4036/two.rs b/tests/source/issue-4036/two.rs index fa54d2e3e09..fd7c17ba6de 100644 --- a/tests/source/issue-4036/two.rs +++ b/tests/source/issue-4036/two.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true macro_rules! test { () => { diff --git a/tests/source/issue-4041.rs b/tests/source/issue-4041.rs index 274b80f1bc5..a0df7a77516 100644 --- a/tests/source/issue-4041.rs +++ b/tests/source/issue-4041.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! List: //! - Sub list: //! + very long #1 blah blah blah blah blah blah blah blah blah blah blah blah foo baar baxxxxxxxx long line 1231421230912i3091238192038 diff --git a/tests/source/issue-4079.rs b/tests/source/issue-4079.rs index eb1ce5ed2a5..f0e5596571b 100644 --- a/tests/source/issue-4079.rs +++ b/tests/source/issue-4079.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /*! * Lorem ipsum dolor sit amet, consectetur adipiscing elit. In lacinia diff --git a/tests/source/issue-4381/style_edition_2015.rs b/tests/source/issue-4381/style_edition_2015.rs index bb4c9feae1d..f2214360ffc 100644 --- a/tests/source/issue-4381/style_edition_2015.rs +++ b/tests/source/issue-4381/style_edition_2015.rs @@ -1,3 +1,3 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64}; diff --git a/tests/source/issue-447.rs b/tests/source/issue-447.rs index 7c542cb58c2..496066c7d82 100644 --- a/tests/source/issue-447.rs +++ b/tests/source/issue-447.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { if /* shouldn't be dropped diff --git a/tests/source/issue-4530.rs b/tests/source/issue-4530.rs index 6b92122f0c0..a9c20118561 100644 --- a/tests/source/issue-4530.rs +++ b/tests/source/issue-4530.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { let [aaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, cccccccccccccccccccccccccc, ddddddddddddddddddddddddd] = panic!(); } diff --git a/tests/source/issue-4689/one.rs b/tests/source/issue-4689/one.rs index bff090a3525..0d254932c0d 100644 --- a/tests/source/issue-4689/one.rs +++ b/tests/source/issue-4689/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/source/issue-4689/two.rs b/tests/source/issue-4689/two.rs index 217535c046e..2b117148e1c 100644 --- a/tests/source/issue-4689/two.rs +++ b/tests/source/issue-4689/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/source/issue-4791/buggy.rs b/tests/source/issue-4791/buggy.rs index 4760022eeaf..e6dec1b4b4b 100644 --- a/tests/source/issue-4791/buggy.rs +++ b/tests/source/issue-4791/buggy.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 30 -// rustfmt-trailing_comma: Never +//@ rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-trailing_comma: Never struct Foo { group_a: u8, diff --git a/tests/source/issue-4791/trailing_comma.rs b/tests/source/issue-4791/trailing_comma.rs index c56c70faeae..c935ca55935 100644 --- a/tests/source/issue-4791/trailing_comma.rs +++ b/tests/source/issue-4791/trailing_comma.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 30 -// rustfmt-trailing_comma: Always +//@ rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-trailing_comma: Always struct Foo { group_a: u8, diff --git a/tests/source/issue-4926/deeply_nested_struct.rs b/tests/source/issue-4926/deeply_nested_struct.rs index e55e41bd1a5..063e7da95c1 100644 --- a/tests/source/issue-4926/deeply_nested_struct.rs +++ b/tests/source/issue-4926/deeply_nested_struct.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/source/issue-4926/deeply_nested_struct_with_long_field_names.rs b/tests/source/issue-4926/deeply_nested_struct_with_long_field_names.rs index 516699fa2b8..d262cf3e5da 100644 --- a/tests/source/issue-4926/deeply_nested_struct_with_long_field_names.rs +++ b/tests/source/issue-4926/deeply_nested_struct_with_long_field_names.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { really_really_long_field_a: i32, diff --git a/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs b/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs index 38fd6f02cf0..bb445a2ed72 100644 --- a/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs +++ b/tests/source/issue-4926/deeply_nested_struct_with_many_fields.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/source/issue-4926/enum_struct_field.rs b/tests/source/issue-4926/enum_struct_field.rs index 336378537df..dcee8529bb5 100644 --- a/tests/source/issue-4926/enum_struct_field.rs +++ b/tests/source/issue-4926/enum_struct_field.rs @@ -1,6 +1,6 @@ -// rustfmt-struct_field_align_threshold: 30 -// rustfmt-enum_discrim_align_threshold: 30 -// rustfmt-imports_layout: HorizontalVertical +//@ rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-enum_discrim_align_threshold: 30 +//@ rustfmt-imports_layout: HorizontalVertical #[derive(Default)] struct InnerStructA { bbbbbbbbb: i32, cccccccc: i32 } diff --git a/tests/source/issue-4926/minimum_example.rs b/tests/source/issue-4926/minimum_example.rs index 2c3045dea48..7e7fce97ff6 100644 --- a/tests/source/issue-4926/minimum_example.rs +++ b/tests/source/issue-4926/minimum_example.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, b: i32 } diff --git a/tests/source/issue-4926/struct_with_long_field_names.rs b/tests/source/issue-4926/struct_with_long_field_names.rs index b8a37f0714e..93572b41238 100644 --- a/tests/source/issue-4926/struct_with_long_field_names.rs +++ b/tests/source/issue-4926/struct_with_long_field_names.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { really_really_long_field_a: i32, diff --git a/tests/source/issue-4926/struct_with_many_fields.rs b/tests/source/issue-4926/struct_with_many_fields.rs index 4adfd3b3062..b9afdbacf8b 100644 --- a/tests/source/issue-4926/struct_with_many_fields.rs +++ b/tests/source/issue-4926/struct_with_many_fields.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/source/issue-5023.rs b/tests/source/issue-5023.rs index 2a6f4a90aa9..62a66d49bdd 100644 --- a/tests/source/issue-5023.rs +++ b/tests/source/issue-5023.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // below we try and force a split at a byte in the middle of a multi-byte // character. The two parts of the first line are constructed such that: diff --git a/tests/source/issue-5030.rs b/tests/source/issue-5030.rs index 08ffaac7d1d..615627eb060 100644 --- a/tests/source/issue-5030.rs +++ b/tests/source/issue-5030.rs @@ -1,5 +1,5 @@ -// rustfmt-imports_granularity: Item -// rustfmt-group_imports: One +//@ rustfmt-imports_granularity: Item +//@ rustfmt-group_imports: One // Confirm that attributes are duplicated to all items in the use statement #[cfg(feature = "foo")] diff --git a/tests/source/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs b/tests/source/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs index 09f68cae424..10aef08eeb5 100644 --- a/tests/source/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs +++ b/tests/source/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true fn main() { { diff --git a/tests/source/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs b/tests/source/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs index 75f748000f9..0ea83d93e3b 100644 --- a/tests/source/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs +++ b/tests/source/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. diff --git a/tests/source/issue-5088/very_long_comment_wrap_comments_true.rs b/tests/source/issue-5088/very_long_comment_wrap_comments_true.rs index 00437f00216..886051c9a5a 100644 --- a/tests/source/issue-5088/very_long_comment_wrap_comments_true.rs +++ b/tests/source/issue-5088/very_long_comment_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. diff --git a/tests/source/issue-5136-1.rs b/tests/source/issue-5136-1.rs index 75231555232..99b781cc89f 100644 --- a/tests/source/issue-5136-1.rs +++ b/tests/source/issue-5136-1.rs @@ -4,4 +4,4 @@ // in the --file-lines range. // This should prevent rustfmt from many any formatting changes at all: -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] diff --git a/tests/source/issue-5136-2.rs b/tests/source/issue-5136-2.rs index fe3cfcf37b8..428aac02ad4 100644 --- a/tests/source/issue-5136-2.rs +++ b/tests/source/issue-5136-2.rs @@ -2,4 +2,4 @@ // Test that whitespace at beginning of file is preserved when not in // --file-lines range. // This should prevent rustfmt from making any formatting changes at all: -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] diff --git a/tests/source/issue-5136-3.rs b/tests/source/issue-5136-3.rs index c152181bc2f..83ad8b91e8b 100644 --- a/tests/source/issue-5136-3.rs +++ b/tests/source/issue-5136-3.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // Test that a missing newline at the end of the file is preserved when the last // line is not in the --file-lines range. // Important: When editing this file, make sure not to add a newline at the end diff --git a/tests/source/issue-5136-4.rs b/tests/source/issue-5136-4.rs index 005167dff63..1350393ad2b 100644 --- a/tests/source/issue-5136-4.rs +++ b/tests/source/issue-5136-4.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // Test that a missing space at the end of a doc comment is preserved when the // line is not in the --file-lines range. //! diff --git a/tests/source/issue-5136-5.rs b/tests/source/issue-5136-5.rs index 0f836aa989f..ba3beccb75f 100644 --- a/tests/source/issue-5136-5.rs +++ b/tests/source/issue-5136-5.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // Test that the space before the comment is not removed if the line is not // contained in `--file-lines`. // Note: It's important for the bug to repro that there is no newline at the diff --git a/tests/source/issue-5157/indented_itemized_markdown_blockquote.rs b/tests/source/issue-5157/indented_itemized_markdown_blockquote.rs index 5c1d79a7430..2b77f59c864 100644 --- a/tests/source/issue-5157/indented_itemized_markdown_blockquote.rs +++ b/tests/source/issue-5157/indented_itemized_markdown_blockquote.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a sample_state relative to each DataReader. The sample_state can either be READ or NOT_READ. fn block_quote() {} diff --git a/tests/source/issue-5157/nested_itemized_markdown_blockquote.rs b/tests/source/issue-5157/nested_itemized_markdown_blockquote.rs index cf200d04e08..af3293b0b3d 100644 --- a/tests/source/issue-5157/nested_itemized_markdown_blockquote.rs +++ b/tests/source/issue-5157/nested_itemized_markdown_blockquote.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a sample_state relative to each DataReader. The sample_state can either be READ or NOT_READ. /// diff --git a/tests/source/issue-5157/support_itemized_markdown_blockquote.rs b/tests/source/issue-5157/support_itemized_markdown_blockquote.rs index eb436402e4e..f93b4d08a8a 100644 --- a/tests/source/issue-5157/support_itemized_markdown_blockquote.rs +++ b/tests/source/issue-5157/support_itemized_markdown_blockquote.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a sample_state relative to each DataReader. The sample_state can either be READ or NOT_READ. fn block_quote() {} diff --git a/tests/source/issue-5234.rs b/tests/source/issue-5234.rs index 67266f485d3..2e3f9c48372 100644 --- a/tests/source/issue-5234.rs +++ b/tests/source/issue-5234.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// ``` /// ``` diff --git a/tests/source/issue-5238/markdown_header_wrap_comments_false.rs b/tests/source/issue-5238/markdown_header_wrap_comments_false.rs index 229c6e5753d..3b2981cf1dd 100644 --- a/tests/source/issue-5238/markdown_header_wrap_comments_false.rs +++ b/tests/source/issue-5238/markdown_header_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false /// no markdown header so rustfmt should wrap this comment when `format_code_in_doc_comments = true` and `wrap_comments = true` fn not_documented_with_markdown_header() { diff --git a/tests/source/issue-5238/markdown_header_wrap_comments_true.rs b/tests/source/issue-5238/markdown_header_wrap_comments_true.rs index c547ff35c69..ceeb177f680 100644 --- a/tests/source/issue-5238/markdown_header_wrap_comments_true.rs +++ b/tests/source/issue-5238/markdown_header_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// no markdown header so rustfmt should wrap this comment when `format_code_in_doc_comments = true` and `wrap_comments = true` fn not_documented_with_markdown_header() { diff --git a/tests/source/issue-5260.rs b/tests/source/issue-5260.rs index c0606817290..479fae719bb 100644 --- a/tests/source/issue-5260.rs +++ b/tests/source/issue-5260.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// [MyType](VeryLongPathToMyType::NoLineBreak::Here::Okay::ThatWouldBeNice::Thanks) fn documented_with_longtype() { diff --git a/tests/source/issue-5270/merge_derives_true.rs b/tests/source/issue-5270/merge_derives_true.rs index b31bbf095e7..bf8f43f0562 100644 --- a/tests/source/issue-5270/merge_derives_true.rs +++ b/tests/source/issue-5270/merge_derives_true.rs @@ -1,4 +1,4 @@ -// rustfmt-merge_derives:true +//@ rustfmt-merge_derives:true #[rustfmt::skip::attributes(derive)] #[allow(dead_code)] diff --git a/tests/source/issue-539.rs b/tests/source/issue-539.rs index d70682e3bee..e0e23e037e9 100644 --- a/tests/source/issue-539.rs +++ b/tests/source/issue-539.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true /* FIXME (#3300): Should allow items to be anonymous. Right now we just use dummy names for anon items. diff --git a/tests/source/issue-5488.rs b/tests/source/issue-5488.rs index d361632e29e..203040d5d16 100644 --- a/tests/source/issue-5488.rs +++ b/tests/source/issue-5488.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: true +//@ rustfmt-use_field_init_shorthand: true struct MyStruct(u32); struct AnotherStruct { diff --git a/tests/source/issue-5586.rs b/tests/source/issue-5586.rs index 061ad4bdaa4..03c5aebcf06 100644 --- a/tests/source/issue-5586.rs +++ b/tests/source/issue-5586.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { // sample 1 { diff --git a/tests/source/issue-5655/one.rs b/tests/source/issue-5655/one.rs index 62df2655c29..8d3d1c4c7b3 100644 --- a/tests/source/issue-5655/one.rs +++ b/tests/source/issue-5655/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn foo(_: T) where diff --git a/tests/source/issue-5655/two.rs b/tests/source/issue-5655/two.rs index bfe1d3813bb..13f90a6c6de 100644 --- a/tests/source/issue-5655/two.rs +++ b/tests/source/issue-5655/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn foo(_: T) where diff --git a/tests/source/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs b/tests/source/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs index 59902c7bcce..0ab81ddd309 100644 --- a/tests/source/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs +++ b/tests/source/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs @@ -1,4 +1,4 @@ -// rustfmt-config: issue-5801-v1.toml +//@ rustfmt-config: issue-5801-v1.toml pub enum Severity { #[something(AAAAAAAAAAAAA, BBBBBBBBBBBBBB, CCCCCCCCCCCCCCCC, DDDDDDDDDDDDD, EEEEEEEEEEEE, FFFFFFFFFFF, GGGGGGGGGGG)] diff --git a/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs b/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs index e61d34604a1..11c23ba5b8a 100644 --- a/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs +++ b/tests/source/issue-5801/comment_unexpectedly_wraps_before_max_width.rs @@ -1,7 +1,7 @@ -// rustfmt-comment_width: 120 -// rustfmt-wrap_comments: true -// rustfmt-max_width: 120 -// rustfmt-style_edition: 2015 +//@ rustfmt-comment_width: 120 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 120 +//@ rustfmt-style_edition: 2015 /// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String { diff --git a/tests/source/issue-5835.rs b/tests/source/issue-5835.rs index 3e4da3492ce..52527f4236c 100644 --- a/tests/source/issue-5835.rs +++ b/tests/source/issue-5835.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// . a pub fn foo() {} diff --git a/tests/source/issue-5852/horizontal.rs b/tests/source/issue-5852/horizontal.rs index 63bfb7e57ce..47a990a16eb 100644 --- a/tests/source/issue-5852/horizontal.rs +++ b/tests/source/issue-5852/horizontal.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_layout: Horizontal +//@ rustfmt-imports_layout: Horizontal use std::{ fs, diff --git a/tests/source/issue-5852/horizontal_vertical.rs b/tests/source/issue-5852/horizontal_vertical.rs index 3f3ce066909..ac7c2fec906 100644 --- a/tests/source/issue-5852/horizontal_vertical.rs +++ b/tests/source/issue-5852/horizontal_vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_layout: HorizontalVertical +//@ rustfmt-imports_layout: HorizontalVertical use std::{ fs, diff --git a/tests/source/issue-5852/split.rs b/tests/source/issue-5852/split.rs index 14e9ea1b6ca..3dc79733348 100644 --- a/tests/source/issue-5852/split.rs +++ b/tests/source/issue-5852/split.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Item +//@ rustfmt-imports_granularity: Item use std::{ fs, diff --git a/tests/source/issue-5852/vertical.rs b/tests/source/issue-5852/vertical.rs index b9ba99889ac..20177e5e145 100644 --- a/tests/source/issue-5852/vertical.rs +++ b/tests/source/issue-5852/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_layout: Vertical +//@ rustfmt-imports_layout: Vertical use std::{ fs, diff --git a/tests/source/issue-5987/two.rs b/tests/source/issue-5987/two.rs index 98ed35c4f9a..a11626407cd 100644 --- a/tests/source/issue-5987/two.rs +++ b/tests/source/issue-5987/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { trace!( diff --git a/tests/source/issue-6147/case_rustfmt_v1.rs b/tests/source/issue-6147/case_rustfmt_v1.rs index bcae86aaff2..4afc72424e8 100644 --- a/tests/source/issue-6147/case_rustfmt_v1.rs +++ b/tests/source/issue-6147/case_rustfmt_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 pub fn main() { let a = Some(12); diff --git a/tests/source/issue-6147/case_rustfmt_v2.rs b/tests/source/issue-6147/case_rustfmt_v2.rs index da612b213fc..3a249693236 100644 --- a/tests/source/issue-6147/case_rustfmt_v2.rs +++ b/tests/source/issue-6147/case_rustfmt_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub fn main() { let a = Some(12); diff --git a/tests/source/issue-6202/long_pat.rs b/tests/source/issue-6202/long_pat.rs index 4444a4a78cb..39d4589edcd 100644 --- a/tests/source/issue-6202/long_pat.rs +++ b/tests/source/issue-6202/long_pat.rs @@ -1,7 +1,7 @@ -// rustfmt-max_width: 120 -// rustfmt-error_on_line_overflow: true -// rustfmt-style_edition: 2027 -// rustfmt-edition: 2024 +//@ rustfmt-max_width: 120 +//@ rustfmt-error_on_line_overflow: true +//@ rustfmt-style_edition: 2027 +//@ rustfmt-edition: 2024 impl EarlyLintPass for NeedlessContinue { fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { diff --git a/tests/source/issue-6243.rs b/tests/source/issue-6243.rs index d883f2bb239..470838d23a4 100644 --- a/tests/source/issue-6243.rs +++ b/tests/source/issue-6243.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Module +//@ rustfmt-imports_granularity: Module use risingwave_batch::executor::{BoxedExecutor, JoinType}; use risingwave_batch::executor::{BoxedExecutor, JoinType}; diff --git a/tests/source/issue-6333.rs b/tests/source/issue-6333.rs index 074610f8252..6cc1dfdfaa4 100644 --- a/tests/source/issue-6333.rs +++ b/tests/source/issue-6333.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2021 -// rustfmt-max_width: 125 +//@ rustfmt-edition: 2021 +//@ rustfmt-max_width: 125 pub use ::dafny_runtime::Sequence; pub use ::std::rc::Rc; pub use crate::r#_StructuredEncryptionUtil_Compile::CanonCryptoItem; diff --git a/tests/source/issue-6561/trait-fn.rs b/tests/source/issue-6561/trait-fn.rs index f88c69dadda..b61c7ae51b6 100644 --- a/tests/source/issue-6561/trait-fn.rs +++ b/tests/source/issue-6561/trait-fn.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2015 +//@ rustfmt-edition: 2015 trait A { fn f1(#[allow()] u32); diff --git a/tests/source/issue-6651/custom_width.rs b/tests/source/issue-6651/custom_width.rs index b6bbe715290..6bdfb562f53 100644 --- a/tests/source/issue-6651/custom_width.rs +++ b/tests/source/issue-6651/custom_width.rs @@ -1,6 +1,6 @@ -// rustfmt-format_macro_bodies: true -// rustfmt-max_width: 82 -// rustfmt-fn_call_width: 76 +//@ rustfmt-format_macro_bodies: true +//@ rustfmt-max_width: 82 +//@ rustfmt-fn_call_width: 76 macro_rules! short { () => { diff --git a/tests/source/issue-6651/default.rs b/tests/source/issue-6651/default.rs index de8e64b4094..316779c601e 100644 --- a/tests/source/issue-6651/default.rs +++ b/tests/source/issue-6651/default.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: true +//@ rustfmt-format_macro_bodies: true macro_rules! short { () => { diff --git a/tests/source/issue-6795.rs b/tests/source/issue-6795.rs index d1263ffc5d9..5b6f43979e9 100644 --- a/tests/source/issue-6795.rs +++ b/tests/source/issue-6795.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: true +//@ rustfmt-use_field_init_shorthand: true foo!(Foo { a: a }); diff --git a/tests/source/issue-6825.rs b/tests/source/issue-6825.rs index 67677f14fdb..0e137892436 100644 --- a/tests/source/issue-6825.rs +++ b/tests/source/issue-6825.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2024 +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2024 pub async fn foo( // OriginalUri(original_uri): OriginalUri, ) -> Option>>> { diff --git a/tests/source/issue-683.rs b/tests/source/issue-683.rs index fd99015ea51..8121bf2e29a 100644 --- a/tests/source/issue-683.rs +++ b/tests/source/issue-683.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true /* * FIXME (#3300): Should allow items to be anonymous. Right now * we just use dummy names for anon items. diff --git a/tests/source/issue-6863/empty-stmt.rs b/tests/source/issue-6863/empty-stmt.rs index 050fbb9c525..160a6a61fc8 100644 --- a/tests/source/issue-6863/empty-stmt.rs +++ b/tests/source/issue-6863/empty-stmt.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-6863/empty-stmt.rs","range":[5,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-6863/empty-stmt.rs","range":[5,5]}] fn main() { ; diff --git a/tests/source/issue-6863/fn-stmts.rs b/tests/source/issue-6863/fn-stmts.rs index e677f842bd5..5d49170a14e 100644 --- a/tests/source/issue-6863/fn-stmts.rs +++ b/tests/source/issue-6863/fn-stmts.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-6863/fn-stmts.rs","range":[5,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-6863/fn-stmts.rs","range":[5,5]}] fn main() { println!("a"); diff --git a/tests/source/issue-7054.rs b/tests/source/issue-7054.rs index 3ae28c21329..dbfcc5b5628 100644 --- a/tests/source/issue-7054.rs +++ b/tests/source/issue-7054.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 // `for await` is spelled with two tokens, so the source may separate them with // arbitrary whitespace or comments. rustfmt must not search for the rendered diff --git a/tests/source/issue-977.rs b/tests/source/issue-977.rs index fe16387b7b2..861e6c0005b 100644 --- a/tests/source/issue-977.rs +++ b/tests/source/issue-977.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true trait NameC { /* comment */ } struct FooC { /* comment */ } diff --git a/tests/source/issue_1306.rs b/tests/source/issue_1306.rs index 03b78e34108..98b9f04f051 100644 --- a/tests/source/issue_1306.rs +++ b/tests/source/issue_1306.rs @@ -1,8 +1,8 @@ -// rustfmt-max_width: 160 -// rustfmt-fn_call_width: 96 -// rustfmt-fn_args_layout: Compressed -// rustfmt-trailing_comma: Always -// rustfmt-wrap_comments: true +//@ rustfmt-max_width: 160 +//@ rustfmt-fn_call_width: 96 +//@ rustfmt-fn_args_layout: Compressed +//@ rustfmt-trailing_comma: Always +//@ rustfmt-wrap_comments: true fn foo() { for elem in try!(gen_epub_book::ops::parse_descriptor_file(&mut try!(File::open(&opts.source_file.1).map_err(|_| { diff --git a/tests/source/issue_4057.rs b/tests/source/issue_4057.rs index 7cd80734bd9..fb43edb448a 100644 --- a/tests/source/issue_4057.rs +++ b/tests/source/issue_4057.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// ``` /// # #[rustversion::since(1.36)] diff --git a/tests/source/issue_4579.rs b/tests/source/issue_4579.rs index 73f345233ba..f4a2095fac0 100644 --- a/tests/source/issue_4579.rs +++ b/tests/source/issue_4579.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true #[macro_export] macro_rules! main { diff --git a/tests/source/issue_4584.rs b/tests/source/issue_4584.rs index 695c5590559..962b6cdc658 100644 --- a/tests/source/issue_4584.rs +++ b/tests/source/issue_4584.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual #[derive(Debug,)] pub enum Case { diff --git a/tests/source/issue_5027.rs b/tests/source/issue_5027.rs index a47d6df6f0f..6bd5b91767b 100644 --- a/tests/source/issue_5027.rs +++ b/tests/source/issue_5027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub type Iter<'a, D> = impl DoubleEndedIterator)>+ ExactSizeIterator+ 'a; diff --git a/tests/source/issue_5912.rs b/tests/source/issue_5912.rs index 2265fd2146c..0205cb6e67b 100644 --- a/tests/source/issue_5912.rs +++ b/tests/source/issue_5912.rs @@ -1,5 +1,5 @@ -// rustfmt-match_arm_blocks: false -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-match_arm_blocks: false +//@ rustfmt-control_brace_style: AlwaysNextLine fn foo() { match 0 { diff --git a/tests/source/issue_5920_style_edition_2024.rs b/tests/source/issue_5920_style_edition_2024.rs index 7002338f9fc..cbbeac266b0 100644 --- a/tests/source/issue_5920_style_edition_2024.rs +++ b/tests/source/issue_5920_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 struct Demo { field_name_foo: (), diff --git a/tests/source/issue_5920_style_edition_2027.rs b/tests/source/issue_5920_style_edition_2027.rs index 9d040a37699..e1bccb7fdaf 100644 --- a/tests/source/issue_5920_style_edition_2027.rs +++ b/tests/source/issue_5920_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 struct Demo { field_name_foo: (), diff --git a/tests/source/issue_5982_style_edition_2024.rs b/tests/source/issue_5982_style_edition_2024.rs index 01d6a92a450..a7b6ad1082b 100644 --- a/tests/source/issue_5982_style_edition_2024.rs +++ b/tests/source/issue_5982_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 struct Foo { #[cfg(all())] diff --git a/tests/source/issue_5982_style_edition_2027.rs b/tests/source/issue_5982_style_edition_2027.rs index f622cd89b47..b8ce33867df 100644 --- a/tests/source/issue_5982_style_edition_2027.rs +++ b/tests/source/issue_5982_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 struct Foo { #[cfg(all())] diff --git a/tests/source/issue_6121.rs b/tests/source/issue_6121.rs index 4d58766638e..bb5b4d5e2da 100644 --- a/tests/source/issue_6121.rs +++ b/tests/source/issue_6121.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: true +//@ rustfmt-use_try_shorthand: true fn main() { let e: Result<(), &str> = Ok(()); diff --git a/tests/source/issue_6381_style_edition_2027.rs b/tests/source/issue_6381_style_edition_2027.rs index 26b96bfdfbc..c6b2c250d80 100644 --- a/tests/source/issue_6381_style_edition_2027.rs +++ b/tests/source/issue_6381_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 fn my_function_no_wrap_at_exactly_100_characters_wide( my_long_impl_trait_parameter: impl Into, diff --git a/tests/source/issue_6801.rs b/tests/source/issue_6801.rs index a53c2b305e5..dc8eff6ab28 100644 --- a/tests/source/issue_6801.rs +++ b/tests/source/issue_6801.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: true -// rustfmt-comment_width: 80 -// rustfmt-max_width: 200 +//@ rustfmt-wrap_comments: true +//@ rustfmt-comment_width: 80 +//@ rustfmt-max_width: 200 fn foo() { // In this line, the next '.' is exactly at'comment_width' . It should break on that dot diff --git a/tests/source/issue_6831_style_edition_2021.rs b/tests/source/issue_6831_style_edition_2021.rs index 0778433bf1c..8722bdda6b6 100644 --- a/tests/source/issue_6831_style_edition_2021.rs +++ b/tests/source/issue_6831_style_edition_2021.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2021 -// rustfmt-max_width: 100 +//@ rustfmt-style_edition: 2021 +//@ rustfmt-max_width: 100 impl IntoMessage< diff --git a/tests/source/issue_6831_style_edition_2024.rs b/tests/source/issue_6831_style_edition_2024.rs index 94e309a191b..fbff8e9f50a 100644 --- a/tests/source/issue_6831_style_edition_2024.rs +++ b/tests/source/issue_6831_style_edition_2024.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-max_width: 100 +//@ rustfmt-style_edition: 2024 +//@ rustfmt-max_width: 100 impl IntoMessage< diff --git a/tests/source/issue_6831_style_edition_2027.rs b/tests/source/issue_6831_style_edition_2027.rs index 20516d56d68..59da5647347 100644 --- a/tests/source/issue_6831_style_edition_2027.rs +++ b/tests/source/issue_6831_style_edition_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-max_width: 100 +//@ rustfmt-style_edition: 2027 +//@ rustfmt-max_width: 100 impl IntoMessage< diff --git a/tests/source/issue_7003_style_edition_2024.rs b/tests/source/issue_7003_style_edition_2024.rs index f2e21df15da..464509a192b 100644 --- a/tests/source/issue_7003_style_edition_2024.rs +++ b/tests/source/issue_7003_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { _ = if let Some(term_node) = sema diff --git a/tests/source/issue_7003_style_edition_2027.rs b/tests/source/issue_7003_style_edition_2027.rs index eecbd1f42fc..0880d834ba7 100644 --- a/tests/source/issue_7003_style_edition_2027.rs +++ b/tests/source/issue_7003_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 fn main() { _ = if let Some(term_node) = sema diff --git a/tests/source/issue_7055_style_edition_2024.rs b/tests/source/issue_7055_style_edition_2024.rs index 78504383254..1a5bd1661d5 100644 --- a/tests/source/issue_7055_style_edition_2024.rs +++ b/tests/source/issue_7055_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // The `removes_trailing_whitespace` case from the 2027 test is deliberately // absent here: at style editions before 2027 rustfmt fails with "left behind diff --git a/tests/source/issue_7055_style_edition_2027.rs b/tests/source/issue_7055_style_edition_2027.rs index 895beea3703..28757d40eac 100644 --- a/tests/source/issue_7055_style_edition_2027.rs +++ b/tests/source/issue_7055_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 struct S; diff --git a/tests/source/issue_7088_stable.rs b/tests/source/issue_7088_stable.rs index a769a71b998..b986c467568 100644 --- a/tests/source/issue_7088_stable.rs +++ b/tests/source/issue_7088_stable.rs @@ -1,4 +1,4 @@ -// rustfmt-stable: true +//@ rustfmt-stable: true // cfg_select! doesn't get formatted, but indentation is updated. diff --git a/tests/source/issue_7088_unstable.rs b/tests/source/issue_7088_unstable.rs index 69c8d246e20..068079767b0 100644 --- a/tests/source/issue_7088_unstable.rs +++ b/tests/source/issue_7088_unstable.rs @@ -1,4 +1,4 @@ -// rustfmt-unstable: true +//@ rustfmt-unstable: true #![crate_type = "lib"] cfg_select! { diff --git a/tests/source/item-brace-style-always-next-line.rs b/tests/source/item-brace-style-always-next-line.rs index 0fb6405120a..3b03fd3197c 100644 --- a/tests/source/item-brace-style-always-next-line.rs +++ b/tests/source/item-brace-style-always-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine mod M { enum A { diff --git a/tests/source/item-brace-style-prefer-same-line.rs b/tests/source/item-brace-style-prefer-same-line.rs index dff89b8b66b..80a94eaf629 100644 --- a/tests/source/item-brace-style-prefer-same-line.rs +++ b/tests/source/item-brace-style-prefer-same-line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine mod M { enum A diff --git a/tests/source/itemized-blocks/no_wrap.rs b/tests/source/itemized-blocks/no_wrap.rs index e5699e76684..20bea68543d 100644 --- a/tests/source/itemized-blocks/no_wrap.rs +++ b/tests/source/itemized-blocks/no_wrap.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_code_in_doc_comments: true //! This is an itemized markdown list (see also issue #3224): //! * Outer diff --git a/tests/source/itemized-blocks/rewrite_fail.rs b/tests/source/itemized-blocks/rewrite_fail.rs index f99c2cc5ff9..125bc1fac5b 100644 --- a/tests/source/itemized-blocks/rewrite_fail.rs +++ b/tests/source/itemized-blocks/rewrite_fail.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 50 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 50 // This example shows how to configure fern to output really nicely colored logs // - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/tests/source/itemized-blocks/urls.rs b/tests/source/itemized-blocks/urls.rs index 2eaaafbbc4a..a723f5fdb74 100644 --- a/tests/source/itemized-blocks/urls.rs +++ b/tests/source/itemized-blocks/urls.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 79 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 79 //! CMSIS: Cortex Microcontroller Software Interface Standard //! diff --git a/tests/source/itemized-blocks/wrap.rs b/tests/source/itemized-blocks/wrap.rs index 768461a43f9..10b0a9b34d1 100644 --- a/tests/source/itemized-blocks/wrap.rs +++ b/tests/source/itemized-blocks/wrap.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: true -// rustfmt-format_code_in_doc_comments: true -// rustfmt-max_width: 50 +//@ rustfmt-wrap_comments: true +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-max_width: 50 //! This is an itemized markdown list (see also issue #3224): //! * Outer diff --git a/tests/source/lazy_static.rs b/tests/source/lazy_static.rs index 633564da577..22da8757740 100644 --- a/tests/source/lazy_static.rs +++ b/tests/source/lazy_static.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 // Format `lazy_static!` and `lazy_static::lazy_static!`. lazy_static! { diff --git a/tests/source/let_chains.rs b/tests/source/let_chains.rs index fc2a9310569..e669e151711 100644 --- a/tests/source/let_chains.rs +++ b/tests/source/let_chains.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2024 +//@ rustfmt-edition: 2024 fn main() { if let x = x && x {} diff --git a/tests/source/let_else.rs b/tests/source/let_else.rs index c589ab75cd3..afb0db8adc8 100644 --- a/tests/source/let_else.rs +++ b/tests/source/let_else.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 100 +//@ rustfmt-single_line_let_else_max_width: 100 fn main() { // Although this won't compile it still parses so make sure we can format empty else blocks diff --git a/tests/source/let_else_v2.rs b/tests/source/let_else_v2.rs index 23be32d629a..1c2e2c37269 100644 --- a/tests/source/let_else_v2.rs +++ b/tests/source/let_else_v2.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-single_line_let_else_max_width: 100 +//@ rustfmt-style_edition: 2024 +//@ rustfmt-single_line_let_else_max_width: 100 fn issue5901() { #[cfg(target_os = "linux")] diff --git a/tests/source/long-fn-1/version_one.rs b/tests/source/long-fn-1/version_one.rs index 60083024810..2fbced77139 100644 --- a/tests/source/long-fn-1/version_one.rs +++ b/tests/source/long-fn-1/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/source/long-fn-1/version_two.rs b/tests/source/long-fn-1/version_two.rs index bce2c551c6a..8c9185b2122 100644 --- a/tests/source/long-fn-1/version_two.rs +++ b/tests/source/long-fn-1/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/source/long-match-arms-brace-newline.rs b/tests/source/long-match-arms-brace-newline.rs index 927ada0ffb2..ee102ad87ec 100644 --- a/tests/source/long-match-arms-brace-newline.rs +++ b/tests/source/long-match-arms-brace-newline.rs @@ -1,6 +1,6 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 80 -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 80 +//@ rustfmt-control_brace_style: AlwaysNextLine fn main() { match x { diff --git a/tests/source/long-use-statement-issue-3154.rs b/tests/source/long-use-statement-issue-3154.rs index 339382b5bbf..a6c414190c3 100644 --- a/tests/source/long-use-statement-issue-3154.rs +++ b/tests/source/long-use-statement-issue-3154.rs @@ -1,3 +1,3 @@ -// rustfmt-reorder_imports: false +//@ rustfmt-reorder_imports: false pub use self :: super :: super :: super :: root::mozilla::detail::StringClassFlags as nsTStringRepr_ClassFlags ; diff --git a/tests/source/macro_rules.rs b/tests/source/macro_rules.rs index 5aaca0c83fa..c06ed94671c 100644 --- a/tests/source/macro_rules.rs +++ b/tests/source/macro_rules.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: true +//@ rustfmt-format_macro_matchers: true macro_rules! m { () => (); diff --git a/tests/source/macros.rs b/tests/source/macros.rs index 2bcb8a787a2..4b6512d361b 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_macro_matchers: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_macro_matchers: true itemmacro!(this, is.now() .formatted(yay)); itemmacro!(really, long.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbb() .is.formatted()); diff --git a/tests/source/markdown-comment-with-options.rs b/tests/source/markdown-comment-with-options.rs index 2c4d6a5cc2b..007dcbb74c1 100644 --- a/tests/source/markdown-comment-with-options.rs +++ b/tests/source/markdown-comment-with-options.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Preserve two trailing whitespaces in doc comment, // but trim any whitespaces in normal comment. diff --git a/tests/source/match-block-trailing-comma.rs b/tests/source/match-block-trailing-comma.rs index baa05b79c16..6ae6f1d4c60 100644 --- a/tests/source/match-block-trailing-comma.rs +++ b/tests/source/match-block-trailing-comma.rs @@ -1,4 +1,4 @@ -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-match_block_trailing_comma: true // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. diff --git a/tests/source/match-nowrap-trailing-comma.rs b/tests/source/match-nowrap-trailing-comma.rs index 134d2fdf9a4..b73a4a3e08a 100644 --- a/tests/source/match-nowrap-trailing-comma.rs +++ b/tests/source/match-nowrap-trailing-comma.rs @@ -1,5 +1,5 @@ -// rustfmt-match_arm_blocks: false -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-match_arm_blocks: false +//@ rustfmt-match_block_trailing_comma: true // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. diff --git a/tests/source/match-nowrap.rs b/tests/source/match-nowrap.rs index db22cd9f010..3ca814c2ba4 100644 --- a/tests/source/match-nowrap.rs +++ b/tests/source/match-nowrap.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_blocks: false +//@ rustfmt-match_arm_blocks: false // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. diff --git a/tests/source/match.rs b/tests/source/match.rs index c171244271f..913638b1fbb 100644 --- a/tests/source/match.rs +++ b/tests/source/match.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Match expressions. fn foo() { diff --git a/tests/source/match_overflow_expr.rs b/tests/source/match_overflow_expr.rs index 91275a89429..fc307f3b6cb 100644 --- a/tests/source/match_overflow_expr.rs +++ b/tests/source/match_overflow_expr.rs @@ -1,4 +1,4 @@ -// rustfmt-overflow_delimited_expr: true +//@ rustfmt-overflow_delimited_expr: true fn main() { println!( diff --git a/tests/source/max-line-length-in-chars.rs b/tests/source/max-line-length-in-chars.rs index d49fbb7e30e..d5aeb75a732 100644 --- a/tests/source/max-line-length-in-chars.rs +++ b/tests/source/max-line-length-in-chars.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 25 +//@ rustfmt-max_width: 25 // абвгдеёжзийклмнопрст fn main() {} diff --git a/tests/source/merge_imports_true_compat.rs b/tests/source/merge_imports_true_compat.rs index bcea9435129..53676695307 100644 --- a/tests/source/merge_imports_true_compat.rs +++ b/tests/source/merge_imports_true_compat.rs @@ -1,4 +1,4 @@ -// rustfmt-merge_imports: true +//@ rustfmt-merge_imports: true use a::b; use a::c; \ No newline at end of file diff --git a/tests/source/mod_skip_child.rs b/tests/source/mod_skip_child.rs index d48c4a37e81..59157d1ec9c 100644 --- a/tests/source/mod_skip_child.rs +++ b/tests/source/mod_skip_child.rs @@ -1,2 +1,2 @@ -// rustfmt-skip_children: true +//@ rustfmt-skip_children: true mod nested_skipped; diff --git a/tests/source/multiple.rs b/tests/source/multiple.rs index f89f4f68da9..69458d6551c 100644 --- a/tests/source/multiple.rs +++ b/tests/source/multiple.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-format_strings: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-format_strings: true // Test of lots of random stuff. // FIXME split this into multiple, self-contained tests. diff --git a/tests/source/non_ascii_numerics_import_asciibetically.rs b/tests/source/non_ascii_numerics_import_asciibetically.rs index bada80dc2fb..3d06f8eb021 100644 --- a/tests/source/non_ascii_numerics_import_asciibetically.rs +++ b/tests/source/non_ascii_numerics_import_asciibetically.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // ascii-betically sorted pub use print๙msg; diff --git a/tests/source/non_ascii_numerics_import_versionsort.rs b/tests/source/non_ascii_numerics_import_versionsort.rs index e82c4a12aa8..fbc42f87af0 100644 --- a/tests/source/non_ascii_numerics_import_versionsort.rs +++ b/tests/source/non_ascii_numerics_import_versionsort.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // versionsorted pub use print๙msg; diff --git a/tests/source/normalize_doc_attributes_should_not_imply_format_doc_comments.rs b/tests/source/normalize_doc_attributes_should_not_imply_format_doc_comments.rs index a97705bfb3b..893d627407b 100644 --- a/tests/source/normalize_doc_attributes_should_not_imply_format_doc_comments.rs +++ b/tests/source/normalize_doc_attributes_should_not_imply_format_doc_comments.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-normalize_doc_attributes: true /// Foo /// diff --git a/tests/source/normalize_multiline_doc_attribute.rs b/tests/source/normalize_multiline_doc_attribute.rs index 3564e3e7ad0..05ab21ad421 100644 --- a/tests/source/normalize_multiline_doc_attribute.rs +++ b/tests/source/normalize_multiline_doc_attribute.rs @@ -1,5 +1,5 @@ -// rustfmt-unstable: true -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-unstable: true +//@ rustfmt-normalize_doc_attributes: true #[doc = "This comment is split diff --git a/tests/source/one_line_if_v1.rs b/tests/source/one_line_if_v1.rs index bf7bc75fb88..d579f2109c1 100644 --- a/tests/source/one_line_if_v1.rs +++ b/tests/source/one_line_if_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn plain_if(x: bool) -> u8 { if x { diff --git a/tests/source/one_line_if_v2.rs b/tests/source/one_line_if_v2.rs index f3c974b12db..a96fae0dbfc 100644 --- a/tests/source/one_line_if_v2.rs +++ b/tests/source/one_line_if_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn plain_if(x: bool) -> u8 { if x { diff --git a/tests/source/path_clarity/foo.rs b/tests/source/path_clarity/foo.rs index cd247fabfe3..262c2232ea3 100644 --- a/tests/source/path_clarity/foo.rs +++ b/tests/source/path_clarity/foo.rs @@ -1,2 +1,2 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 mod bar; diff --git a/tests/source/paths.rs b/tests/source/paths.rs index ebc26f146e4..277aaeef498 100644 --- a/tests/source/paths.rs +++ b/tests/source/paths.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { let constellation_chan = Constellation:: ::start( diff --git a/tests/source/pattern-condense-wildcards.rs b/tests/source/pattern-condense-wildcards.rs index 69c3fa3cbad..53e053a58a9 100644 --- a/tests/source/pattern-condense-wildcards.rs +++ b/tests/source/pattern-condense-wildcards.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-condense_wildcard_suffixes: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-condense_wildcard_suffixes: true fn main() { match x { diff --git a/tests/source/pattern.rs b/tests/source/pattern.rs index 0e5abb52394..fb098158595 100644 --- a/tests/source/pattern.rs +++ b/tests/source/pattern.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true #![feature(exclusive_range_pattern)] use core::u8::MAX; diff --git a/tests/source/preserves_carriage_return_for_unix.rs b/tests/source/preserves_carriage_return_for_unix.rs index e5e0b286598..a3baa9055dc 100644 --- a/tests/source/preserves_carriage_return_for_unix.rs +++ b/tests/source/preserves_carriage_return_for_unix.rs @@ -1,2 +1,3 @@ -// rustfmt-newline_style: Unix -// Foo Bar +//@ rustfmt-newline_style: Unix +// Foo +struct Bar; diff --git a/tests/source/preserves_carriage_return_for_windows.rs b/tests/source/preserves_carriage_return_for_windows.rs index 1085360ee59..ac4725dd649 100644 --- a/tests/source/preserves_carriage_return_for_windows.rs +++ b/tests/source/preserves_carriage_return_for_windows.rs @@ -1,2 +1,3 @@ -// rustfmt-newline_style: Windows -// Foo Bar +//@ rustfmt-newline_style: Windows +// Foo +struct Bar; diff --git a/tests/source/reorder-impl-items.rs b/tests/source/reorder-impl-items.rs index 16efff55b06..a868e60db10 100644 --- a/tests/source/reorder-impl-items.rs +++ b/tests/source/reorder-impl-items.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: true +//@ rustfmt-reorder_impl_items: true // The ordering of the following impl items should be idempotent. impl<'a> Command<'a> { diff --git a/tests/source/reorder_modules/disabled_style_edition_2024.rs b/tests/source/reorder_modules/disabled_style_edition_2024.rs index 0c59d4739fc..2bd635dbf9c 100644 --- a/tests/source/reorder_modules/disabled_style_edition_2024.rs +++ b/tests/source/reorder_modules/disabled_style_edition_2024.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-reorder_modules: false +//@ rustfmt-style_edition: 2024 +//@ rustfmt-reorder_modules: false mod x86; mod v0s; diff --git a/tests/source/reorder_modules/disabled_style_edition_2027.rs b/tests/source/reorder_modules/disabled_style_edition_2027.rs index 4695b06c77b..b760c81e834 100644 --- a/tests/source/reorder_modules/disabled_style_edition_2027.rs +++ b/tests/source/reorder_modules/disabled_style_edition_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-reorder_modules: false +//@ rustfmt-style_edition: 2027 +//@ rustfmt-reorder_modules: false mod x86; mod v0s; diff --git a/tests/source/reorder_modules/enabled_style_edition_2015.rs b/tests/source/reorder_modules/enabled_style_edition_2015.rs index f2ceee8d68e..6522b5b2780 100644 --- a/tests/source/reorder_modules/enabled_style_edition_2015.rs +++ b/tests/source/reorder_modules/enabled_style_edition_2015.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2015 -// rustfmt-reorder_modules: true +//@ rustfmt-style_edition: 2015 +//@ rustfmt-reorder_modules: true mod x86; mod v0s; diff --git a/tests/source/reorder_modules/enabled_style_edition_2024.rs b/tests/source/reorder_modules/enabled_style_edition_2024.rs index bfb6c157bd2..79b230b092f 100644 --- a/tests/source/reorder_modules/enabled_style_edition_2024.rs +++ b/tests/source/reorder_modules/enabled_style_edition_2024.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-reorder_modules: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-reorder_modules: true mod x86; mod v0s; diff --git a/tests/source/reorder_modules/enabled_style_edition_2027.rs b/tests/source/reorder_modules/enabled_style_edition_2027.rs index 6a81e9af742..0b7677b5132 100644 --- a/tests/source/reorder_modules/enabled_style_edition_2027.rs +++ b/tests/source/reorder_modules/enabled_style_edition_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-reorder_modules: true +//@ rustfmt-style_edition: 2027 +//@ rustfmt-reorder_modules: true mod x86; mod v0s; diff --git a/tests/source/single-line-macro/v1.rs b/tests/source/single-line-macro/v1.rs index fea146d8d33..9861eff277d 100644 --- a/tests/source/single-line-macro/v1.rs +++ b/tests/source/single-line-macro/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/source/single-line-macro/v2.rs b/tests/source/single-line-macro/v2.rs index d9fba64ac70..b24045cf097 100644 --- a/tests/source/single-line-macro/v2.rs +++ b/tests/source/single-line-macro/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/source/skip_macro_invocations/all.rs b/tests/source/skip_macro_invocations/all.rs index d0437ee10fd..7194f125e91 100644 --- a/tests/source/skip_macro_invocations/all.rs +++ b/tests/source/skip_macro_invocations/all.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["*"] +//@ rustfmt-skip_macro_invocations: ["*"] // Should skip this invocation items!( diff --git a/tests/source/skip_macro_invocations/all_and_name.rs b/tests/source/skip_macro_invocations/all_and_name.rs index 1f6722344fe..59698b8917b 100644 --- a/tests/source/skip_macro_invocations/all_and_name.rs +++ b/tests/source/skip_macro_invocations/all_and_name.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["*","items"] +//@ rustfmt-skip_macro_invocations: ["*","items"] // Should skip this invocation items!( diff --git a/tests/source/skip_macro_invocations/config_file.rs b/tests/source/skip_macro_invocations/config_file.rs index e0f5ddf52e7..13a138f54e2 100644 --- a/tests/source/skip_macro_invocations/config_file.rs +++ b/tests/source/skip_macro_invocations/config_file.rs @@ -1,5 +1,5 @@ -// rustfmt-unstable: true -// rustfmt-config: issue-5816.toml +//@ rustfmt-unstable: true +//@ rustfmt-config: issue-5816.toml fn main() { println!( "Hello, world!"); diff --git a/tests/source/skip_macro_invocations/empty.rs b/tests/source/skip_macro_invocations/empty.rs index f3dd89dc4db..7961ac5b820 100644 --- a/tests/source/skip_macro_invocations/empty.rs +++ b/tests/source/skip_macro_invocations/empty.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: [] +//@ rustfmt-skip_macro_invocations: [] // Should not skip this invocation items!( diff --git a/tests/source/skip_macro_invocations/name.rs b/tests/source/skip_macro_invocations/name.rs index 7fa5d3a6f71..d10b3397447 100644 --- a/tests/source/skip_macro_invocations/name.rs +++ b/tests/source/skip_macro_invocations/name.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["items"] +//@ rustfmt-skip_macro_invocations: ["items"] // Should skip this invocation items!( diff --git a/tests/source/skip_macro_invocations/name_unknown.rs b/tests/source/skip_macro_invocations/name_unknown.rs index d5669532524..c7423cb4e8c 100644 --- a/tests/source/skip_macro_invocations/name_unknown.rs +++ b/tests/source/skip_macro_invocations/name_unknown.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["unknown"] +//@ rustfmt-skip_macro_invocations: ["unknown"] // Should not skip this invocation items!( diff --git a/tests/source/skip_macro_invocations/names.rs b/tests/source/skip_macro_invocations/names.rs index a920381a455..20319ec9208 100644 --- a/tests/source/skip_macro_invocations/names.rs +++ b/tests/source/skip_macro_invocations/names.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["foo","bar"] +//@ rustfmt-skip_macro_invocations: ["foo","bar"] // Should skip this invocation foo!( diff --git a/tests/source/skip_macro_invocations/path_qualified_invocation_mismatch.rs b/tests/source/skip_macro_invocations/path_qualified_invocation_mismatch.rs index 61296869a50..9ed9e6f014a 100644 --- a/tests/source/skip_macro_invocations/path_qualified_invocation_mismatch.rs +++ b/tests/source/skip_macro_invocations/path_qualified_invocation_mismatch.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["items"] +//@ rustfmt-skip_macro_invocations: ["items"] // Should not skip this invocation self::items!( diff --git a/tests/source/skip_macro_invocations/path_qualified_match.rs b/tests/source/skip_macro_invocations/path_qualified_match.rs index 9398918a9e1..0b88aa6ab2c 100644 --- a/tests/source/skip_macro_invocations/path_qualified_match.rs +++ b/tests/source/skip_macro_invocations/path_qualified_match.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["self::items"] +//@ rustfmt-skip_macro_invocations: ["self::items"] // Should skip this invocation self::items!( diff --git a/tests/source/skip_macro_invocations/path_qualified_name_mismatch.rs b/tests/source/skip_macro_invocations/path_qualified_name_mismatch.rs index 4e3eb542dbe..a6dceeff3ee 100644 --- a/tests/source/skip_macro_invocations/path_qualified_name_mismatch.rs +++ b/tests/source/skip_macro_invocations/path_qualified_name_mismatch.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["self::items"] +//@ rustfmt-skip_macro_invocations: ["self::items"] // Should not skip this invocation items!( diff --git a/tests/source/skip_macro_invocations/use_alias_examples.rs b/tests/source/skip_macro_invocations/use_alias_examples.rs index 43cb8015de5..7042a3efd1c 100644 --- a/tests/source/skip_macro_invocations/use_alias_examples.rs +++ b/tests/source/skip_macro_invocations/use_alias_examples.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["aaa","ccc"] +//@ rustfmt-skip_macro_invocations: ["aaa","ccc"] // These tests demonstrate a realistic use case with use aliases. // The use statements should not impact functionality in any way. diff --git a/tests/source/soft-wrapping.rs b/tests/source/soft-wrapping.rs index b0682d4db3a..010d300bdfc 100644 --- a/tests/source/soft-wrapping.rs +++ b/tests/source/soft-wrapping.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 80 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 80 // Soft wrapping for comments. // #535, soft wrapping for comments diff --git a/tests/source/spaces-around-ranges.rs b/tests/source/spaces-around-ranges.rs index 1936b5e161f..f1c063dc811 100644 --- a/tests/source/spaces-around-ranges.rs +++ b/tests/source/spaces-around-ranges.rs @@ -1,4 +1,4 @@ -// rustfmt-spaces_around_ranges: true +//@ rustfmt-spaces_around_ranges: true fn bar(v: &[u8]) {} diff --git a/tests/source/string-lit.rs b/tests/source/string-lit.rs index 7719e76ffe7..ef39b54e2b5 100644 --- a/tests/source/string-lit.rs +++ b/tests/source/string-lit.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true // Long string literals fn main() -> &'static str { diff --git a/tests/source/string_lit_unicode_ws.rs b/tests/source/string_lit_unicode_ws.rs index fff135fbc4f..f5f9c9703fd 100644 --- a/tests/source/string_lit_unicode_ws.rs +++ b/tests/source/string_lit_unicode_ws.rs @@ -1,4 +1,4 @@ -// rustfmt-show_parse_errors: false +//@ rustfmt-show_parse_errors: false // Test Unicode whitespace characters in string literal line continuation fn main() { diff --git a/tests/source/string_punctuation.rs b/tests/source/string_punctuation.rs index 552c461ed34..47803f0e81a 100644 --- a/tests/source/string_punctuation.rs +++ b/tests/source/string_punctuation.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true fn main() { println!("ThisIsAReallyLongStringWithNoSpaces.It_should_prefer_to_break_onpunctuation:Likethisssssssssssss"); diff --git a/tests/source/struct_lits.rs b/tests/source/struct_lits.rs index c5aaf7ef881..6ab9a4d19fd 100644 --- a/tests/source/struct_lits.rs +++ b/tests/source/struct_lits.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true // Struct literal expressions. fn main() { diff --git a/tests/source/struct_lits_multiline.rs b/tests/source/struct_lits_multiline.rs index 256ba1bbda3..4eb7e3394b8 100644 --- a/tests/source/struct_lits_multiline.rs +++ b/tests/source/struct_lits_multiline.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-struct_lit_single_line: false +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-struct_lit_single_line: false // Struct literal expressions. diff --git a/tests/source/struct_lits_visual.rs b/tests/source/struct_lits_visual.rs index e84652e9ea9..05dda788b27 100644 --- a/tests/source/struct_lits_visual.rs +++ b/tests/source/struct_lits_visual.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-indent_style: Visual +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-indent_style: Visual // Struct literal expressions. diff --git a/tests/source/struct_lits_visual_multiline.rs b/tests/source/struct_lits_visual_multiline.rs index d2990f8da3d..cae03c64d6b 100644 --- a/tests/source/struct_lits_visual_multiline.rs +++ b/tests/source/struct_lits_visual_multiline.rs @@ -1,7 +1,7 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-indent_style: Visual -// rustfmt-struct_lit_single_line: false +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-indent_style: Visual +//@ rustfmt-struct_lit_single_line: false // Struct literal expressions. diff --git a/tests/source/struct_tuple_visual.rs b/tests/source/struct_tuple_visual.rs index f95f3fe4fd3..de2a4c7bb00 100644 --- a/tests/source/struct_tuple_visual.rs +++ b/tests/source/struct_tuple_visual.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-indent_style: Visual +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-indent_style: Visual fn foo() { Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(f(), b()); diff --git a/tests/source/structs.rs b/tests/source/structs.rs index 537151b276a..c49f8b263bd 100644 --- a/tests/source/structs.rs +++ b/tests/source/structs.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true /// A Doc comment #[AnAttribute] diff --git a/tests/source/trailing-comma-never.rs b/tests/source/trailing-comma-never.rs index c74267cd179..a9ebd500c40 100644 --- a/tests/source/trailing-comma-never.rs +++ b/tests/source/trailing-comma-never.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Never +//@ rustfmt-trailing_comma: Never enum X { A, diff --git a/tests/source/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs b/tests/source/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs index 074d2dcdd6a..b793a7b68e4 100644 --- a/tests/source/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs +++ b/tests/source/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2021 -// rustfmt-style_edition: 2027 +//@ rustfmt-edition: 2021 +//@ rustfmt-style_edition: 2027 fn main() { loop { diff --git a/tests/source/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs b/tests/source/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs index 4f0b380c3a5..97e4670ff3c 100644 --- a/tests/source/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs +++ b/tests/source/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2024 +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { loop { diff --git a/tests/source/trailing-semicolon/loop-bodies.rs b/tests/source/trailing-semicolon/loop-bodies.rs index a723d67c395..f99f05d3954 100644 --- a/tests/source/trailing-semicolon/loop-bodies.rs +++ b/tests/source/trailing-semicolon/loop-bodies.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2027 +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2027 macro_rules! dummy { () => {}; diff --git a/tests/source/trailing_commas.rs b/tests/source/trailing_commas.rs index 3e5fcc8080f..8f440c26114 100644 --- a/tests/source/trailing_commas.rs +++ b/tests/source/trailing_commas.rs @@ -1,5 +1,5 @@ -// rustfmt-match_block_trailing_comma: true -// rustfmt-trailing_comma: Always +//@ rustfmt-match_block_trailing_comma: true +//@ rustfmt-trailing_comma: Always fn main() { match foo { diff --git a/tests/source/trailing_comments/hard_tabs.rs b/tests/source/trailing_comments/hard_tabs.rs index c6d1b3f0ab7..80f9c7df9a0 100644 --- a/tests/source/trailing_comments/hard_tabs.rs +++ b/tests/source/trailing_comments/hard_tabs.rs @@ -1,6 +1,6 @@ -// rustfmt-style_edition: 2024 -// rustfmt-wrap_comments: true -// rustfmt-hard_tabs: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-wrap_comments: true +//@ rustfmt-hard_tabs: true impl Foo { fn foo() { diff --git a/tests/source/trailing_comments/soft_tabs.rs b/tests/source/trailing_comments/soft_tabs.rs index 431875989f3..022063811f3 100644 --- a/tests/source/trailing_comments/soft_tabs.rs +++ b/tests/source/trailing_comments/soft_tabs.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-wrap_comments: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-wrap_comments: true pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast // Multicast using broadcst. add. diff --git a/tests/source/try-conversion.rs b/tests/source/try-conversion.rs index ed83ee9e101..3ffb6854452 100644 --- a/tests/source/try-conversion.rs +++ b/tests/source/try-conversion.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: true +//@ rustfmt-use_try_shorthand: true fn main() { let x = try!(some_expr()); diff --git a/tests/source/try_block.rs b/tests/source/try_block.rs index 62f0492f966..8a5b8ce9e62 100644 --- a/tests/source/try_block.rs +++ b/tests/source/try_block.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(try_blocks)] fn main() -> Result<(), !> { diff --git a/tests/source/try_blocks_heterogeneous.rs b/tests/source/try_blocks_heterogeneous.rs index 056bedafef6..b31ea160b64 100644 --- a/tests/source/try_blocks_heterogeneous.rs +++ b/tests/source/try_blocks_heterogeneous.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(try_blocks_heterogeneous)] fn main() -> Result<(), !> { diff --git a/tests/source/tuple_v2.rs b/tests/source/tuple_v2.rs index 6dc18e00d7e..04ef204887f 100644 --- a/tests/source/tuple_v2.rs +++ b/tests/source/tuple_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn issue_4355() { let _ = ((1,),).0 .0; diff --git a/tests/source/type.rs b/tests/source/type.rs index 752cf2e04c4..9f720fd1a9a 100644 --- a/tests/source/type.rs +++ b/tests/source/type.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn types() { let x: [ Vec < _ > ] = []; let y: * mut [ SomeType ; konst_funk() ] = expr(); diff --git a/tests/source/type_alias.rs b/tests/source/type_alias.rs index 58c807f4029..e2b455029c2 100644 --- a/tests/source/type_alias.rs +++ b/tests/source/type_alias.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true type PrivateTest<'a, I> = (Box + 'a>, Box + 'a>); diff --git a/tests/source/unicode.rs b/tests/source/unicode.rs index 4c2119af575..b31b74a102c 100644 --- a/tests/source/unicode.rs +++ b/tests/source/unicode.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true fn foo() { let s = "this line goes to 100: ͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶ"; diff --git a/tests/source/unions.rs b/tests/source/unions.rs index 53630788fe5..b40665894d3 100644 --- a/tests/source/unions.rs +++ b/tests/source/unions.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true /// A Doc comment #[AnAttribute] diff --git a/tests/source/use-identifier-order-mixed-edition.rs b/tests/source/use-identifier-order-mixed-edition.rs index b92c2bca4b9..9899edb85fa 100644 --- a/tests/source/use-identifier-order-mixed-edition.rs +++ b/tests/source/use-identifier-order-mixed-edition.rs @@ -1,6 +1,6 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2021 -// rustfmt-reorder_imports: true +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2021 +//@ rustfmt-reorder_imports: true use a::{ Big, small, t_i_n_y, HUGE, SCREAMING_LOUDLY, or_quietly, OrInTheMiddle diff --git a/tests/source/use-identifier-order.rs b/tests/source/use-identifier-order.rs index 4b9a31fee58..6a8668aa034 100644 --- a/tests/source/use-identifier-order.rs +++ b/tests/source/use-identifier-order.rs @@ -1,6 +1,6 @@ -// rustfmt-edition: 2021 -// rustfmt-style_edition: 2021 -// rustfmt-reorder_imports: true +//@ rustfmt-edition: 2021 +//@ rustfmt-style_edition: 2021 +//@ rustfmt-reorder_imports: true use a::{ Big, small, t_i_n_y, HUGE, SCREAMING_LOUDLY, or_quietly, OrInTheMiddle diff --git a/tests/source/visual-fn-type.rs b/tests/source/visual-fn-type.rs index 67dad5fa460..ff5d0cf5c3d 100644 --- a/tests/source/visual-fn-type.rs +++ b/tests/source/visual-fn-type.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual type CNodeSetAtts = unsafe extern "C" fn(node: *const RsvgNode, node_impl: *const RsvgCNodeImpl, handle: *const RsvgHandle, diff --git a/tests/source/where-clause-comment-wrap-issue-7148.rs b/tests/source/where-clause-comment-wrap-issue-7148.rs index ba6b3966f6c..6a1eb3bb956 100644 --- a/tests/source/where-clause-comment-wrap-issue-7148.rs +++ b/tests/source/where-clause-comment-wrap-issue-7148.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 100 -// rustfmt-comment_width: 100 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 100 +//@ rustfmt-comment_width: 100 // Comments between `where` and the first predicate should be formatted using // the full column budget rather than a budget derived from the header width. diff --git a/tests/source/where-clause.rs b/tests/source/where-clause.rs index 2a916082548..df937b4b8eb 100644 --- a/tests/source/where-clause.rs +++ b/tests/source/where-clause.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo, U: Bar { let mut effects = HashMap::new(); diff --git a/tests/source/width-heuristics.rs b/tests/source/width-heuristics.rs index a591218b4cc..e308c9e9e05 100644 --- a/tests/source/width-heuristics.rs +++ b/tests/source/width-heuristics.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 120 +//@ rustfmt-max_width: 120 // elems on multiple lines for max_width 100, but same line for max_width 120 fn foo(e: Enum) { diff --git a/tests/source/wrap_comments_should_not_imply_format_doc_comments.rs b/tests/source/wrap_comments_should_not_imply_format_doc_comments.rs index 56064e4a4cc..8a302374292 100644 --- a/tests/source/wrap_comments_should_not_imply_format_doc_comments.rs +++ b/tests/source/wrap_comments_should_not_imply_format_doc_comments.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Foo /// diff --git a/tests/target/5131_crate.rs b/tests/target/5131_crate.rs index 557d6670355..4bbd7b10f1d 100644 --- a/tests/target/5131_crate.rs +++ b/tests/target/5131_crate.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Crate +//@ rustfmt-imports_granularity: Crate use foo::{ a, b, b as b2, diff --git a/tests/target/5131_module.rs b/tests/target/5131_module.rs index 763024d6fa4..f7c51b382d2 100644 --- a/tests/target/5131_module.rs +++ b/tests/target/5131_module.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Module +//@ rustfmt-imports_granularity: Module #![allow(dead_code)] diff --git a/tests/target/5131_one.rs b/tests/target/5131_one.rs index a086dae5a42..8fab5da9b1d 100644 --- a/tests/target/5131_one.rs +++ b/tests/target/5131_one.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: One +//@ rustfmt-imports_granularity: One pub use foo::{x, x as x2, y}; use { diff --git a/tests/target/alignment_2633/block_style.rs b/tests/target/alignment_2633/block_style.rs index f13e8a8760e..927b297f770 100644 --- a/tests/target/alignment_2633/block_style.rs +++ b/tests/target/alignment_2633/block_style.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 50 +//@ rustfmt-struct_field_align_threshold: 50 fn func() { Ok(ServerInformation { diff --git a/tests/target/alignment_2633/horizontal_tactic.rs b/tests/target/alignment_2633/horizontal_tactic.rs index a381945fd8b..0b6ab4e1654 100644 --- a/tests/target/alignment_2633/horizontal_tactic.rs +++ b/tests/target/alignment_2633/horizontal_tactic.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 5 +//@ rustfmt-struct_field_align_threshold: 5 #[derive(Fail, Debug, Clone)] pub enum BuildError { diff --git a/tests/target/alignment_2633/visual_style.rs b/tests/target/alignment_2633/visual_style.rs index 7d21b599af4..389749ed451 100644 --- a/tests/target/alignment_2633/visual_style.rs +++ b/tests/target/alignment_2633/visual_style.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 50 -// rustfmt-indent_style: Visual +//@ rustfmt-struct_field_align_threshold: 50 +//@ rustfmt-indent_style: Visual fn func() { Ok(ServerInformation { name: unwrap_message_string(items.get(0)), diff --git a/tests/target/arrow_in_comments/arrow_in_single_comment.rs b/tests/target/arrow_in_comments/arrow_in_single_comment.rs index d638a6b4ef0..4a6e311a2e2 100644 --- a/tests/target/arrow_in_comments/arrow_in_single_comment.rs +++ b/tests/target/arrow_in_comments/arrow_in_single_comment.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { match a { _ => diff --git a/tests/target/arrow_in_comments/multiple_arrows.rs b/tests/target/arrow_in_comments/multiple_arrows.rs index f6f4a60eec3..a03b757316b 100644 --- a/tests/target/arrow_in_comments/multiple_arrows.rs +++ b/tests/target/arrow_in_comments/multiple_arrows.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { match a { _ => diff --git a/tests/target/async_block.rs b/tests/target/async_block.rs index 137d849c9ee..878907b0340 100644 --- a/tests/target/async_block.rs +++ b/tests/target/async_block.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 fn main() { let x = async { Ok(()) }; diff --git a/tests/target/async_closure.rs b/tests/target/async_closure.rs index 9364e7dcc67..83ba5d6637d 100644 --- a/tests/target/async_closure.rs +++ b/tests/target/async_closure.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 fn main() { let async_closure = async { diff --git a/tests/target/async_fn.rs b/tests/target/async_fn.rs index ac151dddb25..b2e365d2bce 100644 --- a/tests/target/async_fn.rs +++ b/tests/target/async_fn.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 async fn bar() -> Result<(), ()> { Ok(()) diff --git a/tests/target/asyncness.rs b/tests/target/asyncness.rs index dd651ed6a62..ef054febdcc 100644 --- a/tests/target/asyncness.rs +++ b/tests/target/asyncness.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 fn foo() -> impl async Fn() {} diff --git a/tests/target/attrib.rs b/tests/target/attrib.rs index 7e61f68d76a..1cae5a1ef5a 100644 --- a/tests/target/attrib.rs +++ b/tests/target/attrib.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Test attributes and doc comments are preserved. #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/tests/target/big-impl-visual.rs b/tests/target/big-impl-visual.rs index 04b0a83fd97..ac4dfb37fbb 100644 --- a/tests/target/big-impl-visual.rs +++ b/tests/target/big-impl-visual.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // #1357 impl<'a, Select, From, Distinct, Where, Order, Limit, Offset, Groupby, DB> InternalBoxedDsl<'a, DB> diff --git a/tests/target/binop-separator-back/bitwise.rs b/tests/target/binop-separator-back/bitwise.rs index ce32c05ef70..582bd355453 100644 --- a/tests/target/binop-separator-back/bitwise.rs +++ b/tests/target/binop-separator-back/bitwise.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ^ diff --git a/tests/target/binop-separator-back/comp.rs b/tests/target/binop-separator-back/comp.rs index efd837bcfe3..e1f1494af61 100644 --- a/tests/target/binop-separator-back/comp.rs +++ b/tests/target/binop-separator-back/comp.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ < diff --git a/tests/target/binop-separator-back/logic.rs b/tests/target/binop-separator-back/logic.rs index 5f69fd5f55e..3f256198a1f 100644 --- a/tests/target/binop-separator-back/logic.rs +++ b/tests/target/binop-separator-back/logic.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { if abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ && diff --git a/tests/target/binop-separator-back/math.rs b/tests/target/binop-separator-back/math.rs index 7a3f27e733b..cffbac06376 100644 --- a/tests/target/binop-separator-back/math.rs +++ b/tests/target/binop-separator-back/math.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + diff --git a/tests/target/binop-separator-back/patterns.rs b/tests/target/binop-separator-back/patterns.rs index 2e59713526a..d27d6d3b7ec 100644 --- a/tests/target/binop-separator-back/patterns.rs +++ b/tests/target/binop-separator-back/patterns.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { match val { diff --git a/tests/target/binop-separator-back/range.rs b/tests/target/binop-separator-back/range.rs index 19e5a81cd9c..ebe8fd044ac 100644 --- a/tests/target/binop-separator-back/range.rs +++ b/tests/target/binop-separator-back/range.rs @@ -1,4 +1,4 @@ -// rustfmt-binop_separator: Back +//@ rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.. diff --git a/tests/target/catch.rs b/tests/target/catch.rs index ffe694f8e72..f90450bd797 100644 --- a/tests/target/catch.rs +++ b/tests/target/catch.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(try_blocks)] fn main() { diff --git a/tests/target/cfg_attribute_in_where.rs b/tests/target/cfg_attribute_in_where.rs index 11f495b1629..314b16f8efd 100644 --- a/tests/target/cfg_attribute_in_where.rs +++ b/tests/target/cfg_attribute_in_where.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 40 +//@ rustfmt-inline_attribute_width: 40 #![crate_type = "lib"] #![feature(cfg_attribute_in_where)] diff --git a/tests/target/cfg_select.rs b/tests/target/cfg_select.rs index fa70ea80dad..1c2a1ed91a7 100644 --- a/tests/target/cfg_select.rs +++ b/tests/target/cfg_select.rs @@ -1,6 +1,6 @@ -// rustfmt-unstable: true -// rustfmt-style_edition: 2024 -// rustfmt-skip_children: true +//@ rustfmt-unstable: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-skip_children: true // empty cfg_select! // Original `{}` delimiters diff --git a/tests/target/cfg_select_stable.rs b/tests/target/cfg_select_stable.rs index 7f37a155cfc..875ad3b53f2 100644 --- a/tests/target/cfg_select_stable.rs +++ b/tests/target/cfg_select_stable.rs @@ -1,4 +1,4 @@ -// rustfmt-stable: true +//@ rustfmt-stable: true // While we gate the `cfg_select!` formatting behind the `is_nightly_channel!()` check // this test helps ensure that we don't start formatting `cfg_select!` on the `stable` diff --git a/tests/target/chain_yield_with_comments.rs b/tests/target/chain_yield_with_comments.rs index 1210759920f..8a20001c2ae 100644 --- a/tests/target/chain_yield_with_comments.rs +++ b/tests/target/chain_yield_with_comments.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2024 +//@ rustfmt-edition: 2024 fn f() { parent /* comment */ diff --git a/tests/target/chains-visual.rs b/tests/target/chains-visual.rs index 76ef99a4b59..ffb9753647f 100644 --- a/tests/target/chains-visual.rs +++ b/tests/target/chains-visual.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Test chain formatting. fn main() { diff --git a/tests/target/chains.rs b/tests/target/chains.rs index 292da298195..a8035e0baab 100644 --- a/tests/target/chains.rs +++ b/tests/target/chains.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Off +//@ rustfmt-use_small_heuristics: Off // Test chain formatting. fn main() { diff --git a/tests/target/closure.rs b/tests/target/closure.rs index e8b4ff7a96b..b114385dc89 100644 --- a/tests/target/closure.rs +++ b/tests/target/closure.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Closures fn main() { diff --git a/tests/target/comment.rs b/tests/target/comment.rs index b987c8a44f3..b1a230bc081 100644 --- a/tests/target/comment.rs +++ b/tests/target/comment.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true //! Doc comment fn test() { diff --git a/tests/target/comment2.rs b/tests/target/comment2.rs index 04f84a15c95..4a8ded0ec2a 100644 --- a/tests/target/comment2.rs +++ b/tests/target/comment2.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// This is a long line that angers rustfmt. Rustfmt shall deal with it swiftly /// and justly. diff --git a/tests/target/comment3.rs b/tests/target/comment3.rs index 3a810590d7b..1a369c8ab8f 100644 --- a/tests/target/comment3.rs +++ b/tests/target/comment3.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! This is a long line that angers rustfmt. Rustfmt shall deal with it swiftly //! and justly. diff --git a/tests/target/comment5.rs b/tests/target/comment5.rs index 82d171e6f6a..fdf9c5bad9f 100644 --- a/tests/target/comment5.rs +++ b/tests/target/comment5.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true //@ special comment //@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. diff --git a/tests/target/comment6.rs b/tests/target/comment6.rs index 565fee632f5..91bd90b224c 100644 --- a/tests/target/comment6.rs +++ b/tests/target/comment6.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Pendant la nuit du 9 mars 1860, les nuages, se confondant avec la mer, // limitaient à quelques brasses la portée de la vue. Sur cette mer démontée, diff --git a/tests/target/comment_crlf_newline.rs b/tests/target/comment_crlf_newline.rs index aab9e94d9e6..a9f4093e076 100644 --- a/tests/target/comment_crlf_newline.rs +++ b/tests/target/comment_crlf_newline.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Block comments followed by CRLF newlines should not an extra newline at the end // Something else diff --git a/tests/target/comments-in-lists/format-doc-comments.rs b/tests/target/comments-in-lists/format-doc-comments.rs index be4b7a8c42e..4e1c1c0cf59 100644 --- a/tests/target/comments-in-lists/format-doc-comments.rs +++ b/tests/target/comments-in-lists/format-doc-comments.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true // https://github.com/rust-lang/rustfmt/issues/4420 enum Minimal { diff --git a/tests/target/comments-in-lists/wrap-comments-false.rs b/tests/target/comments-in-lists/wrap-comments-false.rs index db4da622372..5415e317c52 100644 --- a/tests/target/comments-in-lists/wrap-comments-false.rs +++ b/tests/target/comments-in-lists/wrap-comments-false.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // https://github.com/rust-lang/rustfmt/issues/4909 pub enum E { diff --git a/tests/target/comments-in-lists/wrap-comments-not-normalized.rs b/tests/target/comments-in-lists/wrap-comments-not-normalized.rs index 9b9147eb124..d0363d79156 100644 --- a/tests/target/comments-in-lists/wrap-comments-not-normalized.rs +++ b/tests/target/comments-in-lists/wrap-comments-not-normalized.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // https://github.com/rust-lang/rustfmt/issues/4909 pub enum E { diff --git a/tests/target/comments-in-lists/wrap-comments-true.rs b/tests/target/comments-in-lists/wrap-comments-true.rs index c1531d22a4a..88f363758bb 100644 --- a/tests/target/comments-in-lists/wrap-comments-true.rs +++ b/tests/target/comments-in-lists/wrap-comments-true.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true // https://github.com/rust-lang/rustfmt/issues/4909 pub enum E { diff --git a/tests/target/configs/blank_lines_lower_bound/1.rs b/tests/target/configs/blank_lines_lower_bound/1.rs index 9706699dc7a..d5c9bf81d90 100644 --- a/tests/target/configs/blank_lines_lower_bound/1.rs +++ b/tests/target/configs/blank_lines_lower_bound/1.rs @@ -1,4 +1,4 @@ -// rustfmt-blank_lines_lower_bound: 1 +//@ rustfmt-blank_lines_lower_bound: 1 fn foo() {} diff --git a/tests/target/configs/blank_lines_upper_bound/1.rs b/tests/target/configs/blank_lines_upper_bound/1.rs index 4519e11c159..c2b59beb1ee 100644 --- a/tests/target/configs/blank_lines_upper_bound/1.rs +++ b/tests/target/configs/blank_lines_upper_bound/1.rs @@ -1,4 +1,4 @@ -// rustfmt-blank_lines_upper_bound: 1 +//@ rustfmt-blank_lines_upper_bound: 1 fn do_stuff() { let i = 0; diff --git a/tests/target/configs/blank_lines_upper_bound/2.rs b/tests/target/configs/blank_lines_upper_bound/2.rs index f43f8115015..131329ab089 100644 --- a/tests/target/configs/blank_lines_upper_bound/2.rs +++ b/tests/target/configs/blank_lines_upper_bound/2.rs @@ -1,4 +1,4 @@ -// rustfmt-blank_lines_upper_bound: 2 +//@ rustfmt-blank_lines_upper_bound: 2 fn do_stuff() { let i = 0; diff --git a/tests/target/configs/brace_style/fn_always_next_line.rs b/tests/target/configs/brace_style/fn_always_next_line.rs index 2755a264689..b5452643254 100644 --- a/tests/target/configs/brace_style/fn_always_next_line.rs +++ b/tests/target/configs/brace_style/fn_always_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine // Function brace style fn lorem() diff --git a/tests/target/configs/brace_style/fn_prefer_same_line.rs b/tests/target/configs/brace_style/fn_prefer_same_line.rs index 23f98b6dd7a..1c49bd1fa9b 100644 --- a/tests/target/configs/brace_style/fn_prefer_same_line.rs +++ b/tests/target/configs/brace_style/fn_prefer_same_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Function brace style fn lorem() { diff --git a/tests/target/configs/brace_style/fn_same_line_where.rs b/tests/target/configs/brace_style/fn_same_line_where.rs index 2afe59943a3..01fe91dadfe 100644 --- a/tests/target/configs/brace_style/fn_same_line_where.rs +++ b/tests/target/configs/brace_style/fn_same_line_where.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: SameLineWhere +//@ rustfmt-brace_style: SameLineWhere // Function brace style fn lorem() { diff --git a/tests/target/configs/brace_style/item_always_next_line.rs b/tests/target/configs/brace_style/item_always_next_line.rs index c13018630be..843932ceaba 100644 --- a/tests/target/configs/brace_style/item_always_next_line.rs +++ b/tests/target/configs/brace_style/item_always_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine // Item brace style enum Foo {} diff --git a/tests/target/configs/brace_style/item_prefer_same_line.rs b/tests/target/configs/brace_style/item_prefer_same_line.rs index 5143d7517c7..d2791d952fd 100644 --- a/tests/target/configs/brace_style/item_prefer_same_line.rs +++ b/tests/target/configs/brace_style/item_prefer_same_line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Item brace style struct Lorem { diff --git a/tests/target/configs/brace_style/item_same_line_where.rs b/tests/target/configs/brace_style/item_same_line_where.rs index 8a3b2852654..efde7643cd8 100644 --- a/tests/target/configs/brace_style/item_same_line_where.rs +++ b/tests/target/configs/brace_style/item_same_line_where.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: SameLineWhere +//@ rustfmt-brace_style: SameLineWhere // Item brace style struct Lorem { diff --git a/tests/target/configs/chain_width/always.rs b/tests/target/configs/chain_width/always.rs index b16d25251f6..d61ecfdace0 100644 --- a/tests/target/configs/chain_width/always.rs +++ b/tests/target/configs/chain_width/always.rs @@ -1,4 +1,4 @@ -// rustfmt-chain_width: 1 +//@ rustfmt-chain_width: 1 // setting an unachievable chain_width to always get chains // on separate lines diff --git a/tests/target/configs/chain_width/small.rs b/tests/target/configs/chain_width/small.rs index 2f2f72777f8..23404ff4d2c 100644 --- a/tests/target/configs/chain_width/small.rs +++ b/tests/target/configs/chain_width/small.rs @@ -1,4 +1,4 @@ -// rustfmt-chain_width: 40 +//@ rustfmt-chain_width: 40 struct Fluent {} diff --git a/tests/target/configs/chain_width/tiny.rs b/tests/target/configs/chain_width/tiny.rs index 960d245f8a1..801973172a6 100644 --- a/tests/target/configs/chain_width/tiny.rs +++ b/tests/target/configs/chain_width/tiny.rs @@ -1,4 +1,4 @@ -// rustfmt-chain_width: 20 +//@ rustfmt-chain_width: 20 struct Fluent {} diff --git a/tests/target/configs/combine_control_expr/false.rs b/tests/target/configs/combine_control_expr/false.rs index 0ab82024937..924c4e3ce24 100644 --- a/tests/target/configs/combine_control_expr/false.rs +++ b/tests/target/configs/combine_control_expr/false.rs @@ -1,5 +1,5 @@ -// rustfmt-indent_style: Block -// rustfmt-combine_control_expr: false +//@ rustfmt-indent_style: Block +//@ rustfmt-combine_control_expr: false // Combining openings and closings. See rust-lang/fmt-rfcs#61. diff --git a/tests/target/configs/combine_control_expr/true.rs b/tests/target/configs/combine_control_expr/true.rs index aa41e021fb7..930456670d9 100644 --- a/tests/target/configs/combine_control_expr/true.rs +++ b/tests/target/configs/combine_control_expr/true.rs @@ -1,5 +1,5 @@ -// rustfmt-indent_style: Block -// rustfmt-combine_control_expr: true +//@ rustfmt-indent_style: Block +//@ rustfmt-combine_control_expr: true // Combining openings and closings. See rust-lang/fmt-rfcs#61. diff --git a/tests/target/configs/comment_width/above.rs b/tests/target/configs/comment_width/above.rs index ddfecda65c1..c29e8ff50a9 100644 --- a/tests/target/configs/comment_width/above.rs +++ b/tests/target/configs/comment_width/above.rs @@ -1,5 +1,5 @@ -// rustfmt-comment_width: 40 -// rustfmt-wrap_comments: true +//@ rustfmt-comment_width: 40 +//@ rustfmt-wrap_comments: true // Comment width fn main() { diff --git a/tests/target/configs/comment_width/below.rs b/tests/target/configs/comment_width/below.rs index abbc5930c4c..11c0d925cd7 100644 --- a/tests/target/configs/comment_width/below.rs +++ b/tests/target/configs/comment_width/below.rs @@ -1,5 +1,5 @@ -// rustfmt-comment_width: 80 -// rustfmt-wrap_comments: true +//@ rustfmt-comment_width: 80 +//@ rustfmt-wrap_comments: true // Comment width fn main() { diff --git a/tests/target/configs/comment_width/ignore.rs b/tests/target/configs/comment_width/ignore.rs index c86e71c2898..6adb0ff1e0b 100644 --- a/tests/target/configs/comment_width/ignore.rs +++ b/tests/target/configs/comment_width/ignore.rs @@ -1,5 +1,5 @@ -// rustfmt-comment_width: 40 -// rustfmt-wrap_comments: false +//@ rustfmt-comment_width: 40 +//@ rustfmt-wrap_comments: false // Comment width fn main() { diff --git a/tests/target/configs/condense_wildcard_suffixes/false.rs b/tests/target/configs/condense_wildcard_suffixes/false.rs index 3b967f35a8e..f0e52ead0aa 100644 --- a/tests/target/configs/condense_wildcard_suffixes/false.rs +++ b/tests/target/configs/condense_wildcard_suffixes/false.rs @@ -1,4 +1,4 @@ -// rustfmt-condense_wildcard_suffixes: false +//@ rustfmt-condense_wildcard_suffixes: false // Condense wildcard suffixes fn main() { diff --git a/tests/target/configs/condense_wildcard_suffixes/true.rs b/tests/target/configs/condense_wildcard_suffixes/true.rs index 4f880abe80e..2bed1e5a59a 100644 --- a/tests/target/configs/condense_wildcard_suffixes/true.rs +++ b/tests/target/configs/condense_wildcard_suffixes/true.rs @@ -1,4 +1,4 @@ -// rustfmt-condense_wildcard_suffixes: true +//@ rustfmt-condense_wildcard_suffixes: true // Condense wildcard suffixes fn main() { diff --git a/tests/target/configs/control_brace_style/always_next_line.rs b/tests/target/configs/control_brace_style/always_next_line.rs index 7dc06f207fe..84fb4c38a7c 100644 --- a/tests/target/configs/control_brace_style/always_next_line.rs +++ b/tests/target/configs/control_brace_style/always_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-control_brace_style: AlwaysNextLine // Control brace style fn main() { diff --git a/tests/target/configs/control_brace_style/always_same_line.rs b/tests/target/configs/control_brace_style/always_same_line.rs index 993b6b681fe..ff8bda26ab3 100644 --- a/tests/target/configs/control_brace_style/always_same_line.rs +++ b/tests/target/configs/control_brace_style/always_same_line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysSameLine +//@ rustfmt-control_brace_style: AlwaysSameLine // Control brace style fn main() { diff --git a/tests/target/configs/control_brace_style/closing_next_line.rs b/tests/target/configs/control_brace_style/closing_next_line.rs index 013852ee79a..5f3ea451a6b 100644 --- a/tests/target/configs/control_brace_style/closing_next_line.rs +++ b/tests/target/configs/control_brace_style/closing_next_line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: ClosingNextLine +//@ rustfmt-control_brace_style: ClosingNextLine // Control brace style fn main() { diff --git a/tests/target/configs/disable_all_formatting/false.rs b/tests/target/configs/disable_all_formatting/false.rs index 1a0477ddb39..90138f7138c 100644 --- a/tests/target/configs/disable_all_formatting/false.rs +++ b/tests/target/configs/disable_all_formatting/false.rs @@ -1,4 +1,4 @@ -// rustfmt-disable_all_formatting: false +//@ rustfmt-disable_all_formatting: false // Disable all formatting fn main() { diff --git a/tests/target/configs/disable_all_formatting/true.rs b/tests/target/configs/disable_all_formatting/true.rs index 736ccf56942..9dc46b08cc9 100644 --- a/tests/target/configs/disable_all_formatting/true.rs +++ b/tests/target/configs/disable_all_formatting/true.rs @@ -1,4 +1,4 @@ -// rustfmt-disable_all_formatting: true +//@ rustfmt-disable_all_formatting: true // Disable all formatting fn main() { diff --git a/tests/target/configs/doc_comment_code_block_small_heuristics/default-to-max.rs b/tests/target/configs/doc_comment_code_block_small_heuristics/default-to-max.rs index a4ec39c63c4..60f134570af 100644 --- a/tests/target/configs/doc_comment_code_block_small_heuristics/default-to-max.rs +++ b/tests/target/configs/doc_comment_code_block_small_heuristics/default-to-max.rs @@ -1,6 +1,6 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-use_small_heuristics: Default -// rustfmt-doc_comment_code_block_small_heuristics: Max +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-use_small_heuristics: Default +//@ rustfmt-doc_comment_code_block_small_heuristics: Max /// Start of a doc comment. /// diff --git a/tests/target/configs/doc_comment_code_block_small_heuristics/max-to-default.rs b/tests/target/configs/doc_comment_code_block_small_heuristics/max-to-default.rs index b18878ce8e8..2c3055609a4 100644 --- a/tests/target/configs/doc_comment_code_block_small_heuristics/max-to-default.rs +++ b/tests/target/configs/doc_comment_code_block_small_heuristics/max-to-default.rs @@ -1,6 +1,6 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-use_small_heuristics: Max -// rustfmt-doc_comment_code_block_small_heuristics: Default +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-use_small_heuristics: Max +//@ rustfmt-doc_comment_code_block_small_heuristics: Default /// Start of a doc comment. /// diff --git a/tests/target/configs/doc_comment_code_block_width/100.rs b/tests/target/configs/doc_comment_code_block_width/100.rs index c010a28aab6..9f5d3c8f1be 100644 --- a/tests/target/configs/doc_comment_code_block_width/100.rs +++ b/tests/target/configs/doc_comment_code_block_width/100.rs @@ -1,5 +1,5 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-doc_comment_code_block_width: 100 +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-doc_comment_code_block_width: 100 /// ```rust /// impl Test { diff --git a/tests/target/configs/doc_comment_code_block_width/100_greater_max_width.rs b/tests/target/configs/doc_comment_code_block_width/100_greater_max_width.rs index 6bcb99b915f..34e52f1d66a 100644 --- a/tests/target/configs/doc_comment_code_block_width/100_greater_max_width.rs +++ b/tests/target/configs/doc_comment_code_block_width/100_greater_max_width.rs @@ -1,6 +1,6 @@ -// rustfmt-max_width: 50 -// rustfmt-format_code_in_doc_comments: true -// rustfmt-doc_comment_code_block_width: 100 +//@ rustfmt-max_width: 50 +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-doc_comment_code_block_width: 100 /// ```rust /// impl Test { diff --git a/tests/target/configs/doc_comment_code_block_width/50.rs b/tests/target/configs/doc_comment_code_block_width/50.rs index e8ab6f28bdc..7f7a49d26d8 100644 --- a/tests/target/configs/doc_comment_code_block_width/50.rs +++ b/tests/target/configs/doc_comment_code_block_width/50.rs @@ -1,5 +1,5 @@ -// rustfmt-format_code_in_doc_comments: true -// rustfmt-doc_comment_code_block_width: 50 +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-doc_comment_code_block_width: 50 /// ```rust /// impl Test { diff --git a/tests/target/configs/empty_item_single_line/false.rs b/tests/target/configs/empty_item_single_line/false.rs index 174fe330a8d..e74999fb4a1 100644 --- a/tests/target/configs/empty_item_single_line/false.rs +++ b/tests/target/configs/empty_item_single_line/false.rs @@ -1,4 +1,4 @@ -// rustfmt-empty_item_single_line: false +//@ rustfmt-empty_item_single_line: false // Empty impl on single line impl Lorem { diff --git a/tests/target/configs/empty_item_single_line/true.rs b/tests/target/configs/empty_item_single_line/true.rs index 0755485fea9..1089a254e21 100644 --- a/tests/target/configs/empty_item_single_line/true.rs +++ b/tests/target/configs/empty_item_single_line/true.rs @@ -1,4 +1,4 @@ -// rustfmt-empty_item_single_line: true +//@ rustfmt-empty_item_single_line: true // Empty impl on single line impl Lorem {} diff --git a/tests/target/configs/enum_discrim_align_threshold/40.rs b/tests/target/configs/enum_discrim_align_threshold/40.rs index 3ed66039c9d..14f68ecc6c4 100644 --- a/tests/target/configs/enum_discrim_align_threshold/40.rs +++ b/tests/target/configs/enum_discrim_align_threshold/40.rs @@ -1,4 +1,4 @@ -// rustfmt-enum_discrim_align_threshold: 40 +//@ rustfmt-enum_discrim_align_threshold: 40 enum Standard { A = 1, diff --git a/tests/target/configs/error_on_line_overflow/false.rs b/tests/target/configs/error_on_line_overflow/false.rs index fa70ae78352..e064e776488 100644 --- a/tests/target/configs/error_on_line_overflow/false.rs +++ b/tests/target/configs/error_on_line_overflow/false.rs @@ -1,4 +1,4 @@ -// rustfmt-error_on_line_overflow: false +//@ rustfmt-error_on_line_overflow: false // Error on line overflow fn main() { diff --git a/tests/target/configs/error_on_unformatted/false.rs b/tests/target/configs/error_on_unformatted/false.rs index 6a78374e2a2..db2b3ab39b4 100644 --- a/tests/target/configs/error_on_unformatted/false.rs +++ b/tests/target/configs/error_on_unformatted/false.rs @@ -1,4 +1,4 @@ -// rustfmt-error_on_unformatted: false +//@ rustfmt-error_on_unformatted: false // Error on line overflow comment or string literals. // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/tests/target/configs/float_literal_trailing_zero/always.rs b/tests/target/configs/float_literal_trailing_zero/always.rs index 2d64ec87d50..4420f922de2 100644 --- a/tests/target/configs/float_literal_trailing_zero/always.rs +++ b/tests/target/configs/float_literal_trailing_zero/always.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: Always +//@ rustfmt-float_literal_trailing_zero: Always // spaces_around_ranges: false is implied since it's the default fn float_literals() { diff --git a/tests/target/configs/float_literal_trailing_zero/always_spaces_around_ranges_true.rs b/tests/target/configs/float_literal_trailing_zero/always_spaces_around_ranges_true.rs index 087e4956b67..8009bb8b60b 100644 --- a/tests/target/configs/float_literal_trailing_zero/always_spaces_around_ranges_true.rs +++ b/tests/target/configs/float_literal_trailing_zero/always_spaces_around_ranges_true.rs @@ -1,5 +1,5 @@ -// rustfmt-float_literal_trailing_zero: Always -// rustfmt-spaces_around_ranges: true +//@ rustfmt-float_literal_trailing_zero: Always +//@ rustfmt-spaces_around_ranges: true fn float_literals() { let a = 0.0; diff --git a/tests/target/configs/float_literal_trailing_zero/if-no-postfix.rs b/tests/target/configs/float_literal_trailing_zero/if-no-postfix.rs index f4a36e9e345..2689e5c0e0f 100644 --- a/tests/target/configs/float_literal_trailing_zero/if-no-postfix.rs +++ b/tests/target/configs/float_literal_trailing_zero/if-no-postfix.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: IfNoPostfix +//@ rustfmt-float_literal_trailing_zero: IfNoPostfix // spaces_around_ranges: false is implied since it's the default fn float_literals() { diff --git a/tests/target/configs/float_literal_trailing_zero/if-no-postfix_spaces_around_ranges_true.rs b/tests/target/configs/float_literal_trailing_zero/if-no-postfix_spaces_around_ranges_true.rs index b073c34fb8e..2b68173a622 100644 --- a/tests/target/configs/float_literal_trailing_zero/if-no-postfix_spaces_around_ranges_true.rs +++ b/tests/target/configs/float_literal_trailing_zero/if-no-postfix_spaces_around_ranges_true.rs @@ -1,5 +1,5 @@ -// rustfmt-float_literal_trailing_zero: IfNoPostfix -// rustfmt-spaces_around_ranges: true +//@ rustfmt-float_literal_trailing_zero: IfNoPostfix +//@ rustfmt-spaces_around_ranges: true fn float_literals() { let a = 0.0; diff --git a/tests/target/configs/float_literal_trailing_zero/never.rs b/tests/target/configs/float_literal_trailing_zero/never.rs index a0640a615cb..ca699be8040 100644 --- a/tests/target/configs/float_literal_trailing_zero/never.rs +++ b/tests/target/configs/float_literal_trailing_zero/never.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: Never +//@ rustfmt-float_literal_trailing_zero: Never // spaces_around_ranges: false is implied since it's the default fn float_literals() { diff --git a/tests/target/configs/float_literal_trailing_zero/never_spaces_around_ranges_true.rs b/tests/target/configs/float_literal_trailing_zero/never_spaces_around_ranges_true.rs index 939e2069e9c..fd55573244f 100644 --- a/tests/target/configs/float_literal_trailing_zero/never_spaces_around_ranges_true.rs +++ b/tests/target/configs/float_literal_trailing_zero/never_spaces_around_ranges_true.rs @@ -1,5 +1,5 @@ -// rustfmt-float_literal_trailing_zero: Never -// rustfmt-spaces_around_ranges: true +//@ rustfmt-float_literal_trailing_zero: Never +//@ rustfmt-spaces_around_ranges: true fn float_literals() { let a = 0.; diff --git a/tests/target/configs/float_literal_trailing_zero/preserve.rs b/tests/target/configs/float_literal_trailing_zero/preserve.rs index 3f0f764796c..96866dd4fe0 100644 --- a/tests/target/configs/float_literal_trailing_zero/preserve.rs +++ b/tests/target/configs/float_literal_trailing_zero/preserve.rs @@ -1,4 +1,4 @@ -// rustfmt-float_literal_trailing_zero: Preserve +//@ rustfmt-float_literal_trailing_zero: Preserve fn float_literals() { let a = 0.; diff --git a/tests/target/configs/float_literal_trailing_zero/preserve_spaces_around_ranges_true.rs b/tests/target/configs/float_literal_trailing_zero/preserve_spaces_around_ranges_true.rs index 36371bddb2e..030e03ff3d2 100644 --- a/tests/target/configs/float_literal_trailing_zero/preserve_spaces_around_ranges_true.rs +++ b/tests/target/configs/float_literal_trailing_zero/preserve_spaces_around_ranges_true.rs @@ -1,5 +1,5 @@ -// rustfmt-float_literal_trailing_zero: Preserve -// rustfmt-spaces_around_ranges: true +//@ rustfmt-float_literal_trailing_zero: Preserve +//@ rustfmt-spaces_around_ranges: true fn float_literals() { let a = 0.; diff --git a/tests/target/configs/fn_params_layout/compressed.rs b/tests/target/configs/fn_params_layout/compressed.rs index ff32f0f1d58..129e498c961 100644 --- a/tests/target/configs/fn_params_layout/compressed.rs +++ b/tests/target/configs/fn_params_layout/compressed.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Compressed +//@ rustfmt-fn_params_layout: Compressed // Function arguments density trait Lorem { diff --git a/tests/target/configs/fn_params_layout/tall.rs b/tests/target/configs/fn_params_layout/tall.rs index 25a86799af0..ede6a1c2202 100644 --- a/tests/target/configs/fn_params_layout/tall.rs +++ b/tests/target/configs/fn_params_layout/tall.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Tall +//@ rustfmt-fn_params_layout: Tall // Function arguments density trait Lorem { diff --git a/tests/target/configs/fn_params_layout/vertical.rs b/tests/target/configs/fn_params_layout/vertical.rs index b1ae5710843..5f9a50f36fb 100644 --- a/tests/target/configs/fn_params_layout/vertical.rs +++ b/tests/target/configs/fn_params_layout/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Vertical +//@ rustfmt-fn_params_layout: Vertical // Function arguments density trait Lorem { diff --git a/tests/target/configs/fn_params_layout/vertical_style_2027.rs b/tests/target/configs/fn_params_layout/vertical_style_2027.rs index 838940a9689..d14ed4e5f6f 100644 --- a/tests/target/configs/fn_params_layout/vertical_style_2027.rs +++ b/tests/target/configs/fn_params_layout/vertical_style_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-fn_params_layout: Vertical +//@ rustfmt-style_edition: 2027 +//@ rustfmt-fn_params_layout: Vertical // Function arguments density trait Lorem { diff --git a/tests/target/configs/fn_single_line/false.rs b/tests/target/configs/fn_single_line/false.rs index 3d092f0c0bf..da4e24fd72a 100644 --- a/tests/target/configs/fn_single_line/false.rs +++ b/tests/target/configs/fn_single_line/false.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_single_line: false +//@ rustfmt-fn_single_line: false // Single-expression function on single line fn lorem() -> usize { diff --git a/tests/target/configs/fn_single_line/true.rs b/tests/target/configs/fn_single_line/true.rs index 10d94e02f16..11536de9b61 100644 --- a/tests/target/configs/fn_single_line/true.rs +++ b/tests/target/configs/fn_single_line/true.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_single_line: true +//@ rustfmt-fn_single_line: true // Single-expression function on single line fn lorem() -> usize { 42 } diff --git a/tests/target/configs/force_explicit_abi/false.rs b/tests/target/configs/force_explicit_abi/false.rs index 3c48f8e0c78..9ab1865fc07 100644 --- a/tests/target/configs/force_explicit_abi/false.rs +++ b/tests/target/configs/force_explicit_abi/false.rs @@ -1,4 +1,4 @@ -// rustfmt-force_explicit_abi: false +//@ rustfmt-force_explicit_abi: false // Force explicit abi extern { diff --git a/tests/target/configs/force_explicit_abi/true.rs b/tests/target/configs/force_explicit_abi/true.rs index 90f5a8c4ecb..dda311a3177 100644 --- a/tests/target/configs/force_explicit_abi/true.rs +++ b/tests/target/configs/force_explicit_abi/true.rs @@ -1,4 +1,4 @@ -// rustfmt-force_explicit_abi: true +//@ rustfmt-force_explicit_abi: true // Force explicit abi extern "C" { diff --git a/tests/target/configs/force_multiline_block/false.rs b/tests/target/configs/force_multiline_block/false.rs index 7cb4cac1d69..165f8270b69 100644 --- a/tests/target/configs/force_multiline_block/false.rs +++ b/tests/target/configs/force_multiline_block/false.rs @@ -1,4 +1,4 @@ -// rustfmt-force_multiline_blocks: false +//@ rustfmt-force_multiline_blocks: false // Option forces multiline match arm and closure bodies to be wrapped in a block fn main() { diff --git a/tests/target/configs/force_multiline_block/true.rs b/tests/target/configs/force_multiline_block/true.rs index aec50afe5a8..18cc70d8477 100644 --- a/tests/target/configs/force_multiline_block/true.rs +++ b/tests/target/configs/force_multiline_block/true.rs @@ -1,4 +1,4 @@ -// rustfmt-force_multiline_blocks: true +//@ rustfmt-force_multiline_blocks: true // Option forces multiline match arm and closure bodies to be wrapped in a block fn main() { diff --git a/tests/target/configs/format_generated_files/false.rs b/tests/target/configs/format_generated_files/false.rs index dec1e00d117..aa9c83b4094 100644 --- a/tests/target/configs/format_generated_files/false.rs +++ b/tests/target/configs/format_generated_files/false.rs @@ -1,5 +1,5 @@ // @generated -// rustfmt-format_generated_files: false +//@ rustfmt-format_generated_files: false fn main() { diff --git a/tests/target/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs b/tests/target/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs index be03849fe10..f10a83f7900 100644 --- a/tests/target/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs +++ b/tests/target/configs/format_generated_files/false_with_generated_marker_line_search_limit.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: false -// rustfmt-generated_marker_line_search_limit: 15 +//@ rustfmt-format_generated_files: false +//@ rustfmt-generated_marker_line_search_limit: 15 fn main() { diff --git a/tests/target/configs/format_generated_files/false_with_marker_out_scope_size.rs b/tests/target/configs/format_generated_files/false_with_marker_out_scope_size.rs index 93405896a1d..e3350a64d6d 100644 --- a/tests/target/configs/format_generated_files/false_with_marker_out_scope_size.rs +++ b/tests/target/configs/format_generated_files/false_with_marker_out_scope_size.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: false -// rustfmt-generated_marker_line_search_limit: 1 +//@ rustfmt-format_generated_files: false +//@ rustfmt-generated_marker_line_search_limit: 1 fn main() { println!("hello, world"); diff --git a/tests/target/configs/format_generated_files/false_with_zero_search_limit.rs b/tests/target/configs/format_generated_files/false_with_zero_search_limit.rs index 6acd46ed2eb..48a9d5eaab5 100644 --- a/tests/target/configs/format_generated_files/false_with_zero_search_limit.rs +++ b/tests/target/configs/format_generated_files/false_with_zero_search_limit.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: false -// rustfmt-generated_marker_line_search_limit: 0 +//@ rustfmt-format_generated_files: false +//@ rustfmt-generated_marker_line_search_limit: 0 // @generated fn main() { diff --git a/tests/target/configs/format_generated_files/true.rs b/tests/target/configs/format_generated_files/true.rs index 5fea7e8b341..0727f16c9ad 100644 --- a/tests/target/configs/format_generated_files/true.rs +++ b/tests/target/configs/format_generated_files/true.rs @@ -1,5 +1,5 @@ // @generated -// rustfmt-format_generated_files: true +//@ rustfmt-format_generated_files: true fn main() { println!("hello, world"); diff --git a/tests/target/configs/format_generated_files/true_with_marker_in_scope_size.rs b/tests/target/configs/format_generated_files/true_with_marker_in_scope_size.rs index 03bfdfd1c59..edb887587de 100644 --- a/tests/target/configs/format_generated_files/true_with_marker_in_scope_size.rs +++ b/tests/target/configs/format_generated_files/true_with_marker_in_scope_size.rs @@ -1,5 +1,5 @@ -// rustfmt-format_generated_files: true -// rustfmt-generated_marker_line_search_limit: 20 +//@ rustfmt-format_generated_files: true +//@ rustfmt-generated_marker_line_search_limit: 20 fn main() { println!("hello, world"); diff --git a/tests/target/configs/format_generated_files/true_with_marker_not_in_header.rs b/tests/target/configs/format_generated_files/true_with_marker_not_in_header.rs index 3b6280b350e..b6530bcf997 100644 --- a/tests/target/configs/format_generated_files/true_with_marker_not_in_header.rs +++ b/tests/target/configs/format_generated_files/true_with_marker_not_in_header.rs @@ -1,4 +1,4 @@ -// rustfmt-format_generated_files: true +//@ rustfmt-format_generated_files: true fn main() { println!("hello, world"); diff --git a/tests/target/configs/format_macro_bodies/false.rs b/tests/target/configs/format_macro_bodies/false.rs index ec871b25bf7..d22751f4a41 100644 --- a/tests/target/configs/format_macro_bodies/false.rs +++ b/tests/target/configs/format_macro_bodies/false.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: false +//@ rustfmt-format_macro_bodies: false macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/target/configs/format_macro_bodies/true.rs b/tests/target/configs/format_macro_bodies/true.rs index 17ac1498c93..c4baff74b0a 100644 --- a/tests/target/configs/format_macro_bodies/true.rs +++ b/tests/target/configs/format_macro_bodies/true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: true +//@ rustfmt-format_macro_bodies: true macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/target/configs/format_macro_matchers/false.rs b/tests/target/configs/format_macro_matchers/false.rs index 01ecac9879d..818abe3d0be 100644 --- a/tests/target/configs/format_macro_matchers/false.rs +++ b/tests/target/configs/format_macro_matchers/false.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: false +//@ rustfmt-format_macro_matchers: false macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/target/configs/format_macro_matchers/true.rs b/tests/target/configs/format_macro_matchers/true.rs index fa0442e228a..bec84325463 100644 --- a/tests/target/configs/format_macro_matchers/true.rs +++ b/tests/target/configs/format_macro_matchers/true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: true +//@ rustfmt-format_macro_matchers: true macro_rules! foo { ($a: ident : $b: ty) => { $a(42): $b; }; diff --git a/tests/target/configs/format_strings/false.rs b/tests/target/configs/format_strings/false.rs index ecca0d7d1fc..451d8283965 100644 --- a/tests/target/configs/format_strings/false.rs +++ b/tests/target/configs/format_strings/false.rs @@ -1,6 +1,6 @@ -// rustfmt-format_strings: false -// rustfmt-max_width: 50 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-format_strings: false +//@ rustfmt-max_width: 50 +//@ rustfmt-error_on_line_overflow: false // Force format strings fn main() { diff --git a/tests/target/configs/format_strings/true.rs b/tests/target/configs/format_strings/true.rs index fdd5ab2c97d..6f48921ce66 100644 --- a/tests/target/configs/format_strings/true.rs +++ b/tests/target/configs/format_strings/true.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 // Force format strings fn main() { diff --git a/tests/target/configs/group_imports/One-merge_imports.rs b/tests/target/configs/group_imports/One-merge_imports.rs index 52e0e1c5ac2..e4ad29b92e4 100644 --- a/tests/target/configs/group_imports/One-merge_imports.rs +++ b/tests/target/configs/group_imports/One-merge_imports.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: One -// rustfmt-imports_granularity: Crate +//@ rustfmt-group_imports: One +//@ rustfmt-imports_granularity: Crate use super::{ schema::{Context, Payload}, update::convert_publish_payload, diff --git a/tests/target/configs/group_imports/One-nested.rs b/tests/target/configs/group_imports/One-nested.rs index 5b648548260..74ec4e6d553 100644 --- a/tests/target/configs/group_imports/One-nested.rs +++ b/tests/target/configs/group_imports/One-nested.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: One +//@ rustfmt-group_imports: One mod test { use crate::foo::bar; use crate::foo::bar2; diff --git a/tests/target/configs/group_imports/One-no_reorder.rs b/tests/target/configs/group_imports/One-no_reorder.rs index 015e841d014..989ab479aad 100644 --- a/tests/target/configs/group_imports/One-no_reorder.rs +++ b/tests/target/configs/group_imports/One-no_reorder.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: One -// rustfmt-reorder_imports: false +//@ rustfmt-group_imports: One +//@ rustfmt-reorder_imports: false use chrono::Utc; use super::update::convert_publish_payload; use juniper::{FieldError, FieldResult}; diff --git a/tests/target/configs/group_imports/One.rs b/tests/target/configs/group_imports/One.rs index 3094c7ae115..b2859ee6079 100644 --- a/tests/target/configs/group_imports/One.rs +++ b/tests/target/configs/group_imports/One.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: One +//@ rustfmt-group_imports: One use super::schema::{Context, Payload}; use super::update::convert_publish_payload; use crate::models::Event; diff --git a/tests/target/configs/group_imports/StdExternalCrate-merge_imports.rs b/tests/target/configs/group_imports/StdExternalCrate-merge_imports.rs index 5e4064dd811..9b6ed553213 100644 --- a/tests/target/configs/group_imports/StdExternalCrate-merge_imports.rs +++ b/tests/target/configs/group_imports/StdExternalCrate-merge_imports.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: StdExternalCrate -// rustfmt-imports_granularity: Crate +//@ rustfmt-group_imports: StdExternalCrate +//@ rustfmt-imports_granularity: Crate use alloc::{alloc::Layout, vec::Vec}; use core::f32; use std::sync::Arc; diff --git a/tests/target/configs/group_imports/StdExternalCrate-nested.rs b/tests/target/configs/group_imports/StdExternalCrate-nested.rs index daf23375c0e..f55b32bc2a9 100644 --- a/tests/target/configs/group_imports/StdExternalCrate-nested.rs +++ b/tests/target/configs/group_imports/StdExternalCrate-nested.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-group_imports: StdExternalCrate mod test { use std::path; diff --git a/tests/target/configs/group_imports/StdExternalCrate-no_reorder.rs b/tests/target/configs/group_imports/StdExternalCrate-no_reorder.rs index 76d3d6ccb95..847100993e3 100644 --- a/tests/target/configs/group_imports/StdExternalCrate-no_reorder.rs +++ b/tests/target/configs/group_imports/StdExternalCrate-no_reorder.rs @@ -1,5 +1,5 @@ -// rustfmt-group_imports: StdExternalCrate -// rustfmt-reorder_imports: false +//@ rustfmt-group_imports: StdExternalCrate +//@ rustfmt-reorder_imports: false use alloc::alloc::Layout; use std::sync::Arc; diff --git a/tests/target/configs/group_imports/StdExternalCrate-non_consecutive.rs b/tests/target/configs/group_imports/StdExternalCrate-non_consecutive.rs index ecc8ede02cc..2a81c854676 100644 --- a/tests/target/configs/group_imports/StdExternalCrate-non_consecutive.rs +++ b/tests/target/configs/group_imports/StdExternalCrate-non_consecutive.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-group_imports: StdExternalCrate use alloc::alloc::Layout; use chrono::Utc; diff --git a/tests/target/configs/group_imports/StdExternalCrate.rs b/tests/target/configs/group_imports/StdExternalCrate.rs index 08025796898..777bd669aa5 100644 --- a/tests/target/configs/group_imports/StdExternalCrate.rs +++ b/tests/target/configs/group_imports/StdExternalCrate.rs @@ -1,4 +1,4 @@ -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-group_imports: StdExternalCrate use alloc::alloc::Layout; use core::f32; use std::sync::Arc; diff --git a/tests/target/configs/hard_tabs/false.rs b/tests/target/configs/hard_tabs/false.rs index ccfb53d8c86..ee59e2d118b 100644 --- a/tests/target/configs/hard_tabs/false.rs +++ b/tests/target/configs/hard_tabs/false.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: false +//@ rustfmt-hard_tabs: false // Hard tabs fn lorem() -> usize { diff --git a/tests/target/configs/hard_tabs/true.rs b/tests/target/configs/hard_tabs/true.rs index 3ed4e4f20aa..e79e6d30f49 100644 --- a/tests/target/configs/hard_tabs/true.rs +++ b/tests/target/configs/hard_tabs/true.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true // Hard tabs fn lorem() -> usize { diff --git a/tests/target/configs/hex_literal_case/hex_literal_lower.rs b/tests/target/configs/hex_literal_case/hex_literal_lower.rs index d1d284c6df0..861799dff04 100644 --- a/tests/target/configs/hex_literal_case/hex_literal_lower.rs +++ b/tests/target/configs/hex_literal_case/hex_literal_lower.rs @@ -1,4 +1,4 @@ -// rustfmt-hex_literal_case: Lower +//@ rustfmt-hex_literal_case: Lower fn main() { let h1 = 0xcafe_5ea7; let h2 = 0xcafe_f00du32; diff --git a/tests/target/configs/hex_literal_case/hex_literal_preserve.rs b/tests/target/configs/hex_literal_case/hex_literal_preserve.rs index 876592a4f64..3bdc855e3cb 100644 --- a/tests/target/configs/hex_literal_case/hex_literal_preserve.rs +++ b/tests/target/configs/hex_literal_case/hex_literal_preserve.rs @@ -1,4 +1,4 @@ -// rustfmt-hex_literal_case: Preserve +//@ rustfmt-hex_literal_case: Preserve fn main() { let h1 = 0xcAfE_5Ea7; let h2 = 0xCaFe_F00du32; diff --git a/tests/target/configs/hex_literal_case/hex_literal_upper.rs b/tests/target/configs/hex_literal_case/hex_literal_upper.rs index 4336453abae..735d5df0b7c 100644 --- a/tests/target/configs/hex_literal_case/hex_literal_upper.rs +++ b/tests/target/configs/hex_literal_case/hex_literal_upper.rs @@ -1,4 +1,4 @@ -// rustfmt-hex_literal_case: Upper +//@ rustfmt-hex_literal_case: Upper fn main() { let h1 = 0xCAFE_5EA7; let h2 = 0xCAFE_F00Du32; diff --git a/tests/target/configs/imports_indent/block.rs b/tests/target/configs/imports_indent/block.rs index 84c3b26bd6e..e144de6c920 100644 --- a/tests/target/configs/imports_indent/block.rs +++ b/tests/target/configs/imports_indent/block.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_indent: Block +//@ rustfmt-imports_indent: Block use lists::{ definitive_tactic, itemize_list, shape_for_tactic, struct_lit_formatting, struct_lit_shape, diff --git a/tests/target/configs/imports_layout/horizontal_vertical.rs b/tests/target/configs/imports_layout/horizontal_vertical.rs index 4a63556d45b..92cf3b4ca4f 100644 --- a/tests/target/configs/imports_layout/horizontal_vertical.rs +++ b/tests/target/configs/imports_layout/horizontal_vertical.rs @@ -1,5 +1,5 @@ -// rustfmt-imports_indent: Block -// rustfmt-imports_layout: HorizontalVertical +//@ rustfmt-imports_indent: Block +//@ rustfmt-imports_layout: HorizontalVertical use comment::{contains_comment, recover_comment_removed, rewrite_comment, FindUncommented}; use lists::{ diff --git a/tests/target/configs/imports_layout/merge_mixed.rs b/tests/target/configs/imports_layout/merge_mixed.rs index bc0da92fffb..86c2d5f1050 100644 --- a/tests/target/configs/imports_layout/merge_mixed.rs +++ b/tests/target/configs/imports_layout/merge_mixed.rs @@ -1,5 +1,5 @@ -// rustfmt-imports_indent: Block -// rustfmt-imports_granularity: Crate -// rustfmt-imports_layout: Mixed +//@ rustfmt-imports_indent: Block +//@ rustfmt-imports_granularity: Crate +//@ rustfmt-imports_layout: Mixed use std::{fmt, io, str, str::FromStr}; diff --git a/tests/target/configs/imports_layout/mixed.rs b/tests/target/configs/imports_layout/mixed.rs index 5d3349a01bb..b867ec24a71 100644 --- a/tests/target/configs/imports_layout/mixed.rs +++ b/tests/target/configs/imports_layout/mixed.rs @@ -1,5 +1,5 @@ -// rustfmt-imports_indent: Block -// rustfmt-imports_layout: Mixed +//@ rustfmt-imports_indent: Block +//@ rustfmt-imports_layout: Mixed use comment::{contains_comment, recover_comment_removed, rewrite_comment, FindUncommented}; use lists::{ diff --git a/tests/target/configs/indent_style/block_args.rs b/tests/target/configs/indent_style/block_args.rs index 80f4e133356..d8466d032f3 100644 --- a/tests/target/configs/indent_style/block_args.rs +++ b/tests/target/configs/indent_style/block_args.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Function arguments layout fn lorem() {} diff --git a/tests/target/configs/indent_style/block_array.rs b/tests/target/configs/indent_style/block_array.rs index 5d458248c0b..e2a66b5c49a 100644 --- a/tests/target/configs/indent_style/block_array.rs +++ b/tests/target/configs/indent_style/block_array.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Array layout fn main() { diff --git a/tests/target/configs/indent_style/block_call.rs b/tests/target/configs/indent_style/block_call.rs index 19c44dc019a..5ebf9360b87 100644 --- a/tests/target/configs/indent_style/block_call.rs +++ b/tests/target/configs/indent_style/block_call.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Function call style fn main() { diff --git a/tests/target/configs/indent_style/block_chain.rs b/tests/target/configs/indent_style/block_chain.rs index 23340a4aba2..9e33d5ab0e0 100644 --- a/tests/target/configs/indent_style/block_chain.rs +++ b/tests/target/configs/indent_style/block_chain.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Chain indent fn main() { diff --git a/tests/target/configs/indent_style/block_generic.rs b/tests/target/configs/indent_style/block_generic.rs index c4fcaaf65d1..9b6395fc4c1 100644 --- a/tests/target/configs/indent_style/block_generic.rs +++ b/tests/target/configs/indent_style/block_generic.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Generics indent fn lorem< diff --git a/tests/target/configs/indent_style/block_struct_lit.rs b/tests/target/configs/indent_style/block_struct_lit.rs index 656b562266f..dc6c646e449 100644 --- a/tests/target/configs/indent_style/block_struct_lit.rs +++ b/tests/target/configs/indent_style/block_struct_lit.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Struct literal-style fn main() { diff --git a/tests/target/configs/indent_style/block_tab_spaces_call.rs b/tests/target/configs/indent_style/block_tab_spaces_call.rs index 5531e61ddc8..4e28ec24ed6 100644 --- a/tests/target/configs/indent_style/block_tab_spaces_call.rs +++ b/tests/target/configs/indent_style/block_tab_spaces_call.rs @@ -1,6 +1,6 @@ -// rustfmt-indent_style: Block -// rustfmt-max_width: 80 -// rustfmt-tab_spaces: 2 +//@ rustfmt-indent_style: Block +//@ rustfmt-max_width: 80 +//@ rustfmt-tab_spaces: 2 // #1427 fn main() { diff --git a/tests/target/configs/indent_style/block_trailing_comma_call/one.rs b/tests/target/configs/indent_style/block_trailing_comma_call/one.rs index 204dce6d655..74f28add2f5 100644 --- a/tests/target/configs/indent_style/block_trailing_comma_call/one.rs +++ b/tests/target/configs/indent_style/block_trailing_comma_call/one.rs @@ -1,6 +1,6 @@ -// rustfmt-style_edition: 2015 -// rustfmt-error_on_line_overflow: false -// rustfmt-indent_style: Block +//@ rustfmt-style_edition: 2015 +//@ rustfmt-error_on_line_overflow: false +//@ rustfmt-indent_style: Block // rustfmt should not add trailing comma when rewriting macro. See #1528. fn a() { diff --git a/tests/target/configs/indent_style/block_trailing_comma_call/two.rs b/tests/target/configs/indent_style/block_trailing_comma_call/two.rs index 887e8328ccc..c843d255cee 100644 --- a/tests/target/configs/indent_style/block_trailing_comma_call/two.rs +++ b/tests/target/configs/indent_style/block_trailing_comma_call/two.rs @@ -1,6 +1,6 @@ -// rustfmt-style_edition: 2024 -// rustfmt-error_on_line_overflow: false -// rustfmt-indent_style: Block +//@ rustfmt-style_edition: 2024 +//@ rustfmt-error_on_line_overflow: false +//@ rustfmt-indent_style: Block // rustfmt should not add trailing comma when rewriting macro. See #1528. fn a() { diff --git a/tests/target/configs/indent_style/block_where_pred.rs b/tests/target/configs/indent_style/block_where_pred.rs index ad7e0b8f363..58d9ed71389 100644 --- a/tests/target/configs/indent_style/block_where_pred.rs +++ b/tests/target/configs/indent_style/block_where_pred.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Where predicate indent fn lorem() -> T diff --git a/tests/target/configs/indent_style/default.rs b/tests/target/configs/indent_style/default.rs index a8f0902b34e..d2393a124f1 100644 --- a/tests/target/configs/indent_style/default.rs +++ b/tests/target/configs/indent_style/default.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Where style fn lorem() -> T diff --git a/tests/target/configs/indent_style/rfc_control.rs b/tests/target/configs/indent_style/rfc_control.rs index 6619d8b2630..27d21f6e055 100644 --- a/tests/target/configs/indent_style/rfc_control.rs +++ b/tests/target/configs/indent_style/rfc_control.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // #1618 fn main() { diff --git a/tests/target/configs/indent_style/rfc_where.rs b/tests/target/configs/indent_style/rfc_where.rs index a7b9a4f02b3..4d92972142d 100644 --- a/tests/target/configs/indent_style/rfc_where.rs +++ b/tests/target/configs/indent_style/rfc_where.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block // Where style fn lorem() -> T diff --git a/tests/target/configs/indent_style/visual_args.rs b/tests/target/configs/indent_style/visual_args.rs index 04c2eaee3cf..8d015c28b0e 100644 --- a/tests/target/configs/indent_style/visual_args.rs +++ b/tests/target/configs/indent_style/visual_args.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Function arguments layout fn lorem() {} diff --git a/tests/target/configs/indent_style/visual_array.rs b/tests/target/configs/indent_style/visual_array.rs index 1da6ff23738..5d764f6a93f 100644 --- a/tests/target/configs/indent_style/visual_array.rs +++ b/tests/target/configs/indent_style/visual_array.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Array layout fn main() { diff --git a/tests/target/configs/indent_style/visual_call.rs b/tests/target/configs/indent_style/visual_call.rs index 5454c44ef96..709c11890b0 100644 --- a/tests/target/configs/indent_style/visual_call.rs +++ b/tests/target/configs/indent_style/visual_call.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Function call style fn main() { diff --git a/tests/target/configs/indent_style/visual_chain.rs b/tests/target/configs/indent_style/visual_chain.rs index 569f3d8b81d..67602eaf13a 100644 --- a/tests/target/configs/indent_style/visual_chain.rs +++ b/tests/target/configs/indent_style/visual_chain.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Chain indent fn main() { diff --git a/tests/target/configs/indent_style/visual_generics.rs b/tests/target/configs/indent_style/visual_generics.rs index 491075a146d..498d07e2aa5 100644 --- a/tests/target/configs/indent_style/visual_generics.rs +++ b/tests/target/configs/indent_style/visual_generics.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual // Generics indent fn lorem() -> T diff --git a/tests/target/configs/match_arm_blocks/false.rs b/tests/target/configs/match_arm_blocks/false.rs index 7a9834168c7..9b8b4cba4d3 100644 --- a/tests/target/configs/match_arm_blocks/false.rs +++ b/tests/target/configs/match_arm_blocks/false.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_blocks: false +//@ rustfmt-match_arm_blocks: false // Wrap match-arms fn main() { diff --git a/tests/target/configs/match_arm_blocks/true.rs b/tests/target/configs/match_arm_blocks/true.rs index eb9e34059c7..27d53ffe74e 100644 --- a/tests/target/configs/match_arm_blocks/true.rs +++ b/tests/target/configs/match_arm_blocks/true.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_blocks: true +//@ rustfmt-match_arm_blocks: true // Wrap match-arms fn main() { diff --git a/tests/target/configs/match_arm_indent/attrs.rs b/tests/target/configs/match_arm_indent/attrs.rs index 1063294203a..33495b768f9 100644 --- a/tests/target/configs/match_arm_indent/attrs.rs +++ b/tests/target/configs/match_arm_indent/attrs.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false fn single_oneline() { match value { diff --git a/tests/target/configs/match_arm_indent/guards.rs b/tests/target/configs/match_arm_indent/guards.rs index b218c1a9ce2..a4488910148 100644 --- a/tests/target/configs/match_arm_indent/guards.rs +++ b/tests/target/configs/match_arm_indent/guards.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false // Guards are indented if the pattern is longer than 6 characters fn test() { diff --git a/tests/target/configs/match_arm_indent/leading_pipes.rs b/tests/target/configs/match_arm_indent/leading_pipes.rs index 84b94d81485..54115cdafad 100644 --- a/tests/target/configs/match_arm_indent/leading_pipes.rs +++ b/tests/target/configs/match_arm_indent/leading_pipes.rs @@ -1,5 +1,5 @@ -// rustfmt-match_arm_indent: false -// rustfmt-match_arm_leading_pipes: Always +//@ rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_leading_pipes: Always fn pipes() { match value { diff --git a/tests/target/configs/match_arm_indent/nested.rs b/tests/target/configs/match_arm_indent/nested.rs index bd08aacff7a..cea15e6d193 100644 --- a/tests/target/configs/match_arm_indent/nested.rs +++ b/tests/target/configs/match_arm_indent/nested.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false fn r#match() { match value { diff --git a/tests/target/configs/match_arm_indent/noindent-tabs.rs b/tests/target/configs/match_arm_indent/noindent-tabs.rs index a4b6dc2c87e..ed78e90fa6e 100644 --- a/tests/target/configs/match_arm_indent/noindent-tabs.rs +++ b/tests/target/configs/match_arm_indent/noindent-tabs.rs @@ -1,6 +1,6 @@ -// rustfmt-match_arm_indent: false -// rustfmt-hard_tabs: true -// rustfmt-tab_spaces: 8 +//@ rustfmt-match_arm_indent: false +//@ rustfmt-hard_tabs: true +//@ rustfmt-tab_spaces: 8 // Large-indentation style, brought to you by the Linux kernel fn foo() { diff --git a/tests/target/configs/match_arm_indent/noindent.rs b/tests/target/configs/match_arm_indent/noindent.rs index 02db0622ed3..2010936cc87 100644 --- a/tests/target/configs/match_arm_indent/noindent.rs +++ b/tests/target/configs/match_arm_indent/noindent.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false // Don't indent the match arms fn foo() { diff --git a/tests/target/configs/match_arm_indent/patterns.rs b/tests/target/configs/match_arm_indent/patterns.rs index c7cea167878..7c40c4a6721 100644 --- a/tests/target/configs/match_arm_indent/patterns.rs +++ b/tests/target/configs/match_arm_indent/patterns.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false fn multiple() { match body.kind { diff --git a/tests/target/configs/match_arm_indent/unindent.rs b/tests/target/configs/match_arm_indent/unindent.rs index c74518b5e24..6fef8481285 100644 --- a/tests/target/configs/match_arm_indent/unindent.rs +++ b/tests/target/configs/match_arm_indent/unindent.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_indent: false +//@ rustfmt-match_arm_indent: false // Unindent the match arms fn foo() { diff --git a/tests/target/configs/match_arm_leading_pipes/always.rs b/tests/target/configs/match_arm_leading_pipes/always.rs index f2af81eac3c..ccfef22957f 100644 --- a/tests/target/configs/match_arm_leading_pipes/always.rs +++ b/tests/target/configs/match_arm_leading_pipes/always.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_leading_pipes: Always +//@ rustfmt-match_arm_leading_pipes: Always fn foo() { match foo { diff --git a/tests/target/configs/match_arm_leading_pipes/never.rs b/tests/target/configs/match_arm_leading_pipes/never.rs index 345014e4b4e..458a272c299 100644 --- a/tests/target/configs/match_arm_leading_pipes/never.rs +++ b/tests/target/configs/match_arm_leading_pipes/never.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_leading_pipes: Never +//@ rustfmt-match_arm_leading_pipes: Never fn foo() { match foo { diff --git a/tests/target/configs/match_arm_leading_pipes/preserve.rs b/tests/target/configs/match_arm_leading_pipes/preserve.rs index 4775575842a..f7ad73a4547 100644 --- a/tests/target/configs/match_arm_leading_pipes/preserve.rs +++ b/tests/target/configs/match_arm_leading_pipes/preserve.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_leading_pipes: Preserve +//@ rustfmt-match_arm_leading_pipes: Preserve fn foo() { match foo { diff --git a/tests/target/configs/match_block_trailing_comma/false.rs b/tests/target/configs/match_block_trailing_comma/false.rs index 70e02955fb0..9f905e5708f 100644 --- a/tests/target/configs/match_block_trailing_comma/false.rs +++ b/tests/target/configs/match_block_trailing_comma/false.rs @@ -1,4 +1,4 @@ -// rustfmt-match_block_trailing_comma: false +//@ rustfmt-match_block_trailing_comma: false // Match block trailing comma fn main() { diff --git a/tests/target/configs/match_block_trailing_comma/true.rs b/tests/target/configs/match_block_trailing_comma/true.rs index b78b046dc1c..28888ed44c0 100644 --- a/tests/target/configs/match_block_trailing_comma/true.rs +++ b/tests/target/configs/match_block_trailing_comma/true.rs @@ -1,4 +1,4 @@ -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-match_block_trailing_comma: true // Match block trailing comma fn main() { diff --git a/tests/target/configs/merge_derives/true.rs b/tests/target/configs/merge_derives/true.rs index 4d0148b1c6e..2590d1febeb 100644 --- a/tests/target/configs/merge_derives/true.rs +++ b/tests/target/configs/merge_derives/true.rs @@ -1,4 +1,4 @@ -// rustfmt-merge_derives: true +//@ rustfmt-merge_derives: true // Merge multiple derives to a single one. #[bar] diff --git a/tests/target/configs/normalize_comments/false.rs b/tests/target/configs/normalize_comments/false.rs index 488962ed936..181b44d903e 100644 --- a/tests/target/configs/normalize_comments/false.rs +++ b/tests/target/configs/normalize_comments/false.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: false +//@ rustfmt-normalize_comments: false // Normalize comments // Lorem ipsum: diff --git a/tests/target/configs/normalize_comments/true.rs b/tests/target/configs/normalize_comments/true.rs index 0bdbe08ab4f..f50b40583bb 100644 --- a/tests/target/configs/normalize_comments/true.rs +++ b/tests/target/configs/normalize_comments/true.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Normalize comments // Lorem ipsum: diff --git a/tests/target/configs/normalize_doc_attributes/false.rs b/tests/target/configs/normalize_doc_attributes/false.rs index f8eb64273c3..4504624af2a 100644 --- a/tests/target/configs/normalize_doc_attributes/false.rs +++ b/tests/target/configs/normalize_doc_attributes/false.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_doc_attributes: false +//@ rustfmt-normalize_doc_attributes: false // Normalize doc attributes #![doc = " Example documentation"] diff --git a/tests/target/configs/normalize_doc_attributes/true.rs b/tests/target/configs/normalize_doc_attributes/true.rs index fadab985bea..4c4bb24770e 100644 --- a/tests/target/configs/normalize_doc_attributes/true.rs +++ b/tests/target/configs/normalize_doc_attributes/true.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-normalize_doc_attributes: true // Normalize doc attributes //! Example documentation diff --git a/tests/target/configs/remove_nested_parens/remove_nested_parens.rs b/tests/target/configs/remove_nested_parens/remove_nested_parens.rs index d896042c33c..7c39e9c7572 100644 --- a/tests/target/configs/remove_nested_parens/remove_nested_parens.rs +++ b/tests/target/configs/remove_nested_parens/remove_nested_parens.rs @@ -1,4 +1,4 @@ -// rustfmt-remove_nested_parens: true +//@ rustfmt-remove_nested_parens: true fn main() { (foo()); diff --git a/tests/target/configs/reorder_impl_items/false.rs b/tests/target/configs/reorder_impl_items/false.rs index beb99f0fb8e..e31c8bb6b08 100644 --- a/tests/target/configs/reorder_impl_items/false.rs +++ b/tests/target/configs/reorder_impl_items/false.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: false +//@ rustfmt-reorder_impl_items: false struct Dummy; diff --git a/tests/target/configs/reorder_impl_items/true.rs b/tests/target/configs/reorder_impl_items/true.rs index f2294412a99..e0850e41f0c 100644 --- a/tests/target/configs/reorder_impl_items/true.rs +++ b/tests/target/configs/reorder_impl_items/true.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: true +//@ rustfmt-reorder_impl_items: true struct Dummy; diff --git a/tests/target/configs/reorder_imports/false.rs b/tests/target/configs/reorder_imports/false.rs index 4b85684dc01..5554cfa98ba 100644 --- a/tests/target/configs/reorder_imports/false.rs +++ b/tests/target/configs/reorder_imports/false.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: false +//@ rustfmt-reorder_imports: false // Reorder imports use lorem; diff --git a/tests/target/configs/reorder_imports/true.rs b/tests/target/configs/reorder_imports/true.rs index e4ff7295fd0..ecbf6aed179 100644 --- a/tests/target/configs/reorder_imports/true.rs +++ b/tests/target/configs/reorder_imports/true.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: true +//@ rustfmt-reorder_imports: true // Reorder imports use dolor; diff --git a/tests/target/configs/reorder_modules/false.rs b/tests/target/configs/reorder_modules/false.rs index 56b1aa03ed7..d97848d70d4 100644 --- a/tests/target/configs/reorder_modules/false.rs +++ b/tests/target/configs/reorder_modules/false.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_modules: false +//@ rustfmt-reorder_modules: false // Reorder modules mod lorem; diff --git a/tests/target/configs/reorder_modules/true.rs b/tests/target/configs/reorder_modules/true.rs index 18361e88b5f..2470aaa7792 100644 --- a/tests/target/configs/reorder_modules/true.rs +++ b/tests/target/configs/reorder_modules/true.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_modules: true +//@ rustfmt-reorder_modules: true // Reorder modules mod dolor; diff --git a/tests/target/configs/short_array_element_width_threshold/10.rs b/tests/target/configs/short_array_element_width_threshold/10.rs index 78c4adba1c1..169a6bf76ab 100644 --- a/tests/target/configs/short_array_element_width_threshold/10.rs +++ b/tests/target/configs/short_array_element_width_threshold/10.rs @@ -1,4 +1,4 @@ -// rustfmt-short_array_element_width_threshold: 10 +//@ rustfmt-short_array_element_width_threshold: 10 fn main() { pub const FORMAT_TEST: [u64; 5] = [ diff --git a/tests/target/configs/short_array_element_width_threshold/20.rs b/tests/target/configs/short_array_element_width_threshold/20.rs index 6084690652f..236794aff36 100644 --- a/tests/target/configs/short_array_element_width_threshold/20.rs +++ b/tests/target/configs/short_array_element_width_threshold/20.rs @@ -1,4 +1,4 @@ -// rustfmt-short_array_element_width_threshold: 20 +//@ rustfmt-short_array_element_width_threshold: 20 fn main() { pub const FORMAT_TEST: [u64; 5] = [ diff --git a/tests/target/configs/short_array_element_width_threshold/greater_than_max_width.rs b/tests/target/configs/short_array_element_width_threshold/greater_than_max_width.rs index 710b6fe7c4b..f730f26cec8 100644 --- a/tests/target/configs/short_array_element_width_threshold/greater_than_max_width.rs +++ b/tests/target/configs/short_array_element_width_threshold/greater_than_max_width.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 20 -// rustfmt-short_array_element_width_threshold: 30 +//@ rustfmt-max_width: 20 +//@ rustfmt-short_array_element_width_threshold: 30 fn main() { pub const FORMAT_TEST: [u64; 5] = [ diff --git a/tests/target/configs/single_line_let_else_max_width/100.rs b/tests/target/configs/single_line_let_else_max_width/100.rs index 0409124a5b0..e2ad1af42d8 100644 --- a/tests/target/configs/single_line_let_else_max_width/100.rs +++ b/tests/target/configs/single_line_let_else_max_width/100.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 100 +//@ rustfmt-single_line_let_else_max_width: 100 fn main() { let Some(a) = opt else {}; diff --git a/tests/target/configs/single_line_let_else_max_width/50.rs b/tests/target/configs/single_line_let_else_max_width/50.rs index 6afc2b6f2b0..257c4198ee3 100644 --- a/tests/target/configs/single_line_let_else_max_width/50.rs +++ b/tests/target/configs/single_line_let_else_max_width/50.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 50 +//@ rustfmt-single_line_let_else_max_width: 50 fn main() { let Some(a) = opt else {}; diff --git a/tests/target/configs/single_line_let_else_max_width/zero.rs b/tests/target/configs/single_line_let_else_max_width/zero.rs index b5fd0b9edaf..cb86fa52233 100644 --- a/tests/target/configs/single_line_let_else_max_width/zero.rs +++ b/tests/target/configs/single_line_let_else_max_width/zero.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 0 +//@ rustfmt-single_line_let_else_max_width: 0 fn main() { let Some(a) = opt else {}; diff --git a/tests/target/configs/skip_children/true.rs b/tests/target/configs/skip_children/true.rs index 33fd782b4fa..4277af8a334 100644 --- a/tests/target/configs/skip_children/true.rs +++ b/tests/target/configs/skip_children/true.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_children: true +//@ rustfmt-skip_children: true mod foo; mod void; diff --git a/tests/target/configs/space_before_colon/true.rs b/tests/target/configs/space_before_colon/true.rs index e2895b5d77b..afd5a1448a5 100644 --- a/tests/target/configs/space_before_colon/true.rs +++ b/tests/target/configs/space_before_colon/true.rs @@ -1,4 +1,4 @@ -// rustfmt-space_before_colon: true +//@ rustfmt-space_before_colon: true // Space before colon fn lorem(t : T) { diff --git a/tests/target/configs/spaces_around_ranges/false.rs b/tests/target/configs/spaces_around_ranges/false.rs index 9b4ae1e7a8d..3100558b304 100644 --- a/tests/target/configs/spaces_around_ranges/false.rs +++ b/tests/target/configs/spaces_around_ranges/false.rs @@ -1,4 +1,4 @@ -// rustfmt-spaces_around_ranges: false +//@ rustfmt-spaces_around_ranges: false // Spaces around ranges fn main() { diff --git a/tests/target/configs/spaces_around_ranges/true.rs b/tests/target/configs/spaces_around_ranges/true.rs index d450e7b87ee..edd6f1a727b 100644 --- a/tests/target/configs/spaces_around_ranges/true.rs +++ b/tests/target/configs/spaces_around_ranges/true.rs @@ -1,4 +1,4 @@ -// rustfmt-spaces_around_ranges: true +//@ rustfmt-spaces_around_ranges: true // Spaces around ranges fn main() { diff --git a/tests/target/configs/struct_field_align_threshold/20.rs b/tests/target/configs/struct_field_align_threshold/20.rs index 12a523e9d83..ebadcd73069 100644 --- a/tests/target/configs/struct_field_align_threshold/20.rs +++ b/tests/target/configs/struct_field_align_threshold/20.rs @@ -1,7 +1,7 @@ -// rustfmt-struct_field_align_threshold: 20 -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-error_on_line_overflow: false +//@ rustfmt-struct_field_align_threshold: 20 +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-error_on_line_overflow: false struct Foo { x: u32, diff --git a/tests/target/configs/struct_lit_single_line/false.rs b/tests/target/configs/struct_lit_single_line/false.rs index e2732b5a7c9..472de9083ec 100644 --- a/tests/target/configs/struct_lit_single_line/false.rs +++ b/tests/target/configs/struct_lit_single_line/false.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_lit_single_line: false +//@ rustfmt-struct_lit_single_line: false // Struct literal multiline-style fn main() { diff --git a/tests/target/configs/style_edition/overflow_delim_expr_2015.rs b/tests/target/configs/style_edition/overflow_delim_expr_2015.rs index 05d4b8b6d33..ff19c2c3500 100644 --- a/tests/target/configs/style_edition/overflow_delim_expr_2015.rs +++ b/tests/target/configs/style_edition/overflow_delim_expr_2015.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn combine_blocklike() { do_thing(|param| { diff --git a/tests/target/configs/style_edition/overflow_delim_expr_2024.rs b/tests/target/configs/style_edition/overflow_delim_expr_2024.rs index 1b2d12ce320..71b68e01d0c 100644 --- a/tests/target/configs/style_edition/overflow_delim_expr_2024.rs +++ b/tests/target/configs/style_edition/overflow_delim_expr_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn combine_blocklike() { do_thing(|param| { diff --git a/tests/target/configs/tab_spaces/2.rs b/tests/target/configs/tab_spaces/2.rs index 85961706ea7..8f702f2360e 100644 --- a/tests/target/configs/tab_spaces/2.rs +++ b/tests/target/configs/tab_spaces/2.rs @@ -1,6 +1,6 @@ -// rustfmt-tab_spaces: 2 -// rustfmt-max_width: 30 -// rustfmt-indent_style: Block +//@ rustfmt-tab_spaces: 2 +//@ rustfmt-max_width: 30 +//@ rustfmt-indent_style: Block // Tab spaces fn lorem() { diff --git a/tests/target/configs/tab_spaces/4.rs b/tests/target/configs/tab_spaces/4.rs index 524a55121e4..f0f03f00c54 100644 --- a/tests/target/configs/tab_spaces/4.rs +++ b/tests/target/configs/tab_spaces/4.rs @@ -1,6 +1,6 @@ -// rustfmt-tab_spaces: 4 -// rustfmt-max_width: 30 -// rustfmt-indent_style: Block +//@ rustfmt-tab_spaces: 4 +//@ rustfmt-max_width: 30 +//@ rustfmt-indent_style: Block // Tab spaces fn lorem() { diff --git a/tests/target/configs/trailing_comma/always.rs b/tests/target/configs/trailing_comma/always.rs index 951dc680912..5272214578f 100644 --- a/tests/target/configs/trailing_comma/always.rs +++ b/tests/target/configs/trailing_comma/always.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Always +//@ rustfmt-trailing_comma: Always // Trailing comma fn main() { diff --git a/tests/target/configs/trailing_comma/never.rs b/tests/target/configs/trailing_comma/never.rs index ae0e50f96d1..84b2f57636b 100644 --- a/tests/target/configs/trailing_comma/never.rs +++ b/tests/target/configs/trailing_comma/never.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Never +//@ rustfmt-trailing_comma: Never // Trailing comma fn main() { diff --git a/tests/target/configs/trailing_comma/vertical.rs b/tests/target/configs/trailing_comma/vertical.rs index 7283cde8d06..228ffa80438 100644 --- a/tests/target/configs/trailing_comma/vertical.rs +++ b/tests/target/configs/trailing_comma/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Vertical +//@ rustfmt-trailing_comma: Vertical // Trailing comma fn main() { diff --git a/tests/target/configs/trailing_semicolon/false.rs b/tests/target/configs/trailing_semicolon/false.rs index 9fa746e9c0f..109209b36b8 100644 --- a/tests/target/configs/trailing_semicolon/false.rs +++ b/tests/target/configs/trailing_semicolon/false.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_semicolon: false +//@ rustfmt-trailing_semicolon: false #![feature(loop_break_value)] diff --git a/tests/target/configs/trailing_semicolon/true.rs b/tests/target/configs/trailing_semicolon/true.rs index 61b6843d677..94d52fe28ad 100644 --- a/tests/target/configs/trailing_semicolon/true.rs +++ b/tests/target/configs/trailing_semicolon/true.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_semicolon: true +//@ rustfmt-trailing_semicolon: true #![feature(loop_break_value)] diff --git a/tests/target/configs/type_punctuation_density/compressed.rs b/tests/target/configs/type_punctuation_density/compressed.rs index 6571e448e44..2e495d0c6c0 100644 --- a/tests/target/configs/type_punctuation_density/compressed.rs +++ b/tests/target/configs/type_punctuation_density/compressed.rs @@ -1,4 +1,4 @@ -// rustfmt-type_punctuation_density: Compressed +//@ rustfmt-type_punctuation_density: Compressed // Type punctuation density fn lorem() { diff --git a/tests/target/configs/type_punctuation_density/wide.rs b/tests/target/configs/type_punctuation_density/wide.rs index 01546c7b0a5..d040dd47bc7 100644 --- a/tests/target/configs/type_punctuation_density/wide.rs +++ b/tests/target/configs/type_punctuation_density/wide.rs @@ -1,4 +1,4 @@ -// rustfmt-type_punctuation_density: Wide +//@ rustfmt-type_punctuation_density: Wide // Type punctuation density fn lorem() { diff --git a/tests/target/configs/use_field_init_shorthand/false.rs b/tests/target/configs/use_field_init_shorthand/false.rs index 74330446886..4ec75967c78 100644 --- a/tests/target/configs/use_field_init_shorthand/false.rs +++ b/tests/target/configs/use_field_init_shorthand/false.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: false +//@ rustfmt-use_field_init_shorthand: false // Use field initialization shorthand if possible. fn main() { diff --git a/tests/target/configs/use_field_init_shorthand/true.rs b/tests/target/configs/use_field_init_shorthand/true.rs index 8b80e81534b..0e66b487b0b 100644 --- a/tests/target/configs/use_field_init_shorthand/true.rs +++ b/tests/target/configs/use_field_init_shorthand/true.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: true +//@ rustfmt-use_field_init_shorthand: true // Use field initialization shorthand if possible. fn main() { diff --git a/tests/target/configs/use_small_heuristics/default.rs b/tests/target/configs/use_small_heuristics/default.rs index ad40739233e..23a3764201e 100644 --- a/tests/target/configs/use_small_heuristics/default.rs +++ b/tests/target/configs/use_small_heuristics/default.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Default +//@ rustfmt-use_small_heuristics: Default enum Lorem { Ipsum, diff --git a/tests/target/configs/use_small_heuristics/max.rs b/tests/target/configs/use_small_heuristics/max.rs index fe57f853d9d..3f552dab426 100644 --- a/tests/target/configs/use_small_heuristics/max.rs +++ b/tests/target/configs/use_small_heuristics/max.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Max +//@ rustfmt-use_small_heuristics: Max enum Lorem { Ipsum, diff --git a/tests/target/configs/use_small_heuristics/off.rs b/tests/target/configs/use_small_heuristics/off.rs index b0b4e4ee49f..5c0fae41b9f 100644 --- a/tests/target/configs/use_small_heuristics/off.rs +++ b/tests/target/configs/use_small_heuristics/off.rs @@ -1,4 +1,4 @@ -// rustfmt-use_small_heuristics: Off +//@ rustfmt-use_small_heuristics: Off enum Lorem { Ipsum, diff --git a/tests/target/configs/use_try_shorthand/false.rs b/tests/target/configs/use_try_shorthand/false.rs index de7f8b4a5e2..4635cbe9774 100644 --- a/tests/target/configs/use_try_shorthand/false.rs +++ b/tests/target/configs/use_try_shorthand/false.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: false +//@ rustfmt-use_try_shorthand: false // Use try! shorthand fn main() { diff --git a/tests/target/configs/use_try_shorthand/true.rs b/tests/target/configs/use_try_shorthand/true.rs index d3aa035792c..252259f5052 100644 --- a/tests/target/configs/use_try_shorthand/true.rs +++ b/tests/target/configs/use_try_shorthand/true.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: true +//@ rustfmt-use_try_shorthand: true // Use try! shorthand fn main() { diff --git a/tests/target/configs/version/mapped.rs b/tests/target/configs/version/mapped.rs index 296dc559a93..49858963f72 100644 --- a/tests/target/configs/version/mapped.rs +++ b/tests/target/configs/version/mapped.rs @@ -1,4 +1,4 @@ -// rustfmt-version: Two +//@ rustfmt-version: Two fn main() { let [ aaaaaaaaaaaaaaaaaaaaaaaaaa, diff --git a/tests/target/configs/where_single_line/true-with-brace-style.rs b/tests/target/configs/where_single_line/true-with-brace-style.rs index ec7f79b689c..fe69bd4f29f 100644 --- a/tests/target/configs/where_single_line/true-with-brace-style.rs +++ b/tests/target/configs/where_single_line/true-with-brace-style.rs @@ -1,5 +1,5 @@ -// rustfmt-brace_style: SameLineWhere -// rustfmt-where_single_line: true +//@ rustfmt-brace_style: SameLineWhere +//@ rustfmt-where_single_line: true fn lorem_multi_line_clauseless( a: Aaaaaaaaaaaaaaa, diff --git a/tests/target/configs/where_single_line/true.rs b/tests/target/configs/where_single_line/true.rs index 7f816459e3c..7d138e19155 100644 --- a/tests/target/configs/where_single_line/true.rs +++ b/tests/target/configs/where_single_line/true.rs @@ -1,4 +1,4 @@ -// rustfmt-where_single_line: true +//@ rustfmt-where_single_line: true // Where style fn lorem_two_items() -> T diff --git a/tests/target/configs/wrap_comments/false.rs b/tests/target/configs/wrap_comments/false.rs index 48ecd88accb..befe46e10f5 100644 --- a/tests/target/configs/wrap_comments/false.rs +++ b/tests/target/configs/wrap_comments/false.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: false -// rustfmt-max_width: 50 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-wrap_comments: false +//@ rustfmt-max_width: 50 +//@ rustfmt-error_on_line_overflow: false // Wrap comments fn main() { diff --git a/tests/target/configs/wrap_comments/true.rs b/tests/target/configs/wrap_comments/true.rs index 4096fd4d89d..4102d0a54b7 100644 --- a/tests/target/configs/wrap_comments/true.rs +++ b/tests/target/configs/wrap_comments/true.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 50 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 50 // Wrap comments fn main() { diff --git a/tests/target/control-brace-style-always-next-line.rs b/tests/target/control-brace-style-always-next-line.rs index 054a3075ca0..2c2dbc261b1 100644 --- a/tests/target/control-brace-style-always-next-line.rs +++ b/tests/target/control-brace-style-always-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-control_brace_style: AlwaysNextLine fn main() { loop diff --git a/tests/target/crash-on-enum-generics/issue_6318.rs b/tests/target/crash-on-enum-generics/issue_6318.rs index 73471f3eee1..7366ba14389 100644 --- a/tests/target/crash-on-enum-generics/issue_6318.rs +++ b/tests/target/crash-on-enum-generics/issue_6318.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 fn my_fn() { enum MyEnum where diff --git a/tests/target/doc-attrib.rs b/tests/target/doc-attrib.rs index 36527b7cd42..021bede9350 100644 --- a/tests/target/doc-attrib.rs +++ b/tests/target/doc-attrib.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-normalize_doc_attributes: true // Only doc = "" attributes should be normalized //! Example doc attribute comment diff --git a/tests/target/doc-comment-with-example.rs b/tests/target/doc-comment-with-example.rs index c5a4e779ea2..7d860207b6f 100644 --- a/tests/target/doc-comment-with-example.rs +++ b/tests/target/doc-comment-with-example.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// Foo /// diff --git a/tests/target/doc.rs b/tests/target/doc.rs index 0f9e2d21c1f..0d664b2bf19 100644 --- a/tests/target/doc.rs +++ b/tests/target/doc.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Part of multiple.rs // sadfsdfa diff --git a/tests/target/else-if-brace-style-always-next-line.rs b/tests/target/else-if-brace-style-always-next-line.rs index 31e12cfa0d0..f046f6a2dc0 100644 --- a/tests/target/else-if-brace-style-always-next-line.rs +++ b/tests/target/else-if-brace-style-always-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-control_brace_style: AlwaysNextLine fn main() { if false diff --git a/tests/target/else-if-brace-style-closing-next-line.rs b/tests/target/else-if-brace-style-closing-next-line.rs index c99807dc06d..f1180ab96c3 100644 --- a/tests/target/else-if-brace-style-closing-next-line.rs +++ b/tests/target/else-if-brace-style-closing-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-control_brace_style: ClosingNextLine +//@ rustfmt-control_brace_style: ClosingNextLine fn main() { if false { diff --git a/tests/target/empty-item-single-line-false.rs b/tests/target/empty-item-single-line-false.rs index bf7f70e7c43..7f326922fbc 100644 --- a/tests/target/empty-item-single-line-false.rs +++ b/tests/target/empty-item-single-line-false.rs @@ -1,5 +1,5 @@ -// rustfmt-brace_style: AlwaysNextLine -// rustfmt-empty_item_single_line: false +//@ rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-empty_item_single_line: false fn function() { diff --git a/tests/target/enum.rs b/tests/target/enum.rs index 83b30999725..c191b52558c 100644 --- a/tests/target/enum.rs +++ b/tests/target/enum.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Enums test #[atrr] diff --git a/tests/target/ergonomic_clones.rs b/tests/target/ergonomic_clones.rs index 1a8c3b6cbbe..98976719474 100644 --- a/tests/target/ergonomic_clones.rs +++ b/tests/target/ergonomic_clones.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(ergonomic_clones)] diff --git a/tests/target/expr-overflow-delimited.rs b/tests/target/expr-overflow-delimited.rs index b00e81fcd5a..f4da86e005b 100644 --- a/tests/target/expr-overflow-delimited.rs +++ b/tests/target/expr-overflow-delimited.rs @@ -1,4 +1,4 @@ -// rustfmt-overflow_delimited_expr: true +//@ rustfmt-overflow_delimited_expr: true fn combine_blocklike() { do_thing(|param| { diff --git a/tests/target/expr.rs b/tests/target/expr.rs index 187a1dc976a..9ea4141804d 100644 --- a/tests/target/expr.rs +++ b/tests/target/expr.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true // Test expressions fn foo() -> bool { diff --git a/tests/target/extern.rs b/tests/target/extern.rs index d1741360cfd..a0c41c82bf2 100644 --- a/tests/target/extern.rs +++ b/tests/target/extern.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true extern crate foo; extern crate foo as bar; diff --git a/tests/target/extern_not_explicit.rs b/tests/target/extern_not_explicit.rs index b55b64d05b3..9f2ba631b58 100644 --- a/tests/target/extern_not_explicit.rs +++ b/tests/target/extern_not_explicit.rs @@ -1,4 +1,4 @@ -// rustfmt-force_explicit_abi: false +//@ rustfmt-force_explicit_abi: false extern { fn some_fn() -> (); diff --git a/tests/target/file-lines-1.rs b/tests/target/file-lines-1.rs index 13820ec293f..31b15739c50 100644 --- a/tests/target/file-lines-1.rs +++ b/tests/target/file-lines-1.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-1.rs","range":[4,8]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-1.rs","range":[4,8]}] fn floaters() { let x = Foo { diff --git a/tests/target/file-lines-2.rs b/tests/target/file-lines-2.rs index bc25698c2ed..04d8d6c3874 100644 --- a/tests/target/file-lines-2.rs +++ b/tests/target/file-lines-2.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-2.rs","range":[10,15]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-2.rs","range":[10,15]}] fn floaters() { let x = Foo { diff --git a/tests/target/file-lines-3.rs b/tests/target/file-lines-3.rs index 77d6fb26355..0880f93a377 100644 --- a/tests/target/file-lines-3.rs +++ b/tests/target/file-lines-3.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-3.rs","range":[4,8]},{"file":"tests/source/file-lines-3.rs","range":[10,15]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-3.rs","range":[4,8]},{"file":"tests/source/file-lines-3.rs","range":[10,15]}] fn floaters() { let x = Foo { diff --git a/tests/target/file-lines-4.rs b/tests/target/file-lines-4.rs index 83928bf6fec..98295ebd970 100644 --- a/tests/target/file-lines-4.rs +++ b/tests/target/file-lines-4.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // (Test that nothing is formatted if an empty array is specified.) fn floaters() { diff --git a/tests/target/file-lines-5.rs b/tests/target/file-lines-5.rs index 3966dc06303..04a1900e48c 100644 --- a/tests/target/file-lines-5.rs +++ b/tests/target/file-lines-5.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-5.rs","range":[3,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-5.rs","range":[3,5]}] struct A { t: i64, diff --git a/tests/target/file-lines-6.rs b/tests/target/file-lines-6.rs index 8a092df869a..317d2b6e7ad 100644 --- a/tests/target/file-lines-6.rs +++ b/tests/target/file-lines-6.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-6.rs","range":[9,10]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-6.rs","range":[9,10]}] struct A { t: i64, diff --git a/tests/target/file-lines-7.rs b/tests/target/file-lines-7.rs index 62d913d8823..a2987580e43 100644 --- a/tests/target/file-lines-7.rs +++ b/tests/target/file-lines-7.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-7.rs","range":[8,15]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-7.rs","range":[8,15]}] struct A { t: i64, diff --git a/tests/target/file-lines-item.rs b/tests/target/file-lines-item.rs index 8d39eb60958..eb33e424eac 100644 --- a/tests/target/file-lines-item.rs +++ b/tests/target/file-lines-item.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/file-lines-item.rs","range":[6,8]}] +//@ rustfmt-file_lines: [{"file":"tests/source/file-lines-item.rs","range":[6,8]}] use foo::{c, b, a}; use bar; diff --git a/tests/target/fn-custom-6.rs b/tests/target/fn-custom-6.rs index e891f4d5882..33384527516 100644 --- a/tests/target/fn-custom-6.rs +++ b/tests/target/fn-custom-6.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Test different indents. fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { diff --git a/tests/target/fn-custom-7.rs b/tests/target/fn-custom-7.rs index f6a1a90c3fc..1477c265a74 100644 --- a/tests/target/fn-custom-7.rs +++ b/tests/target/fn-custom-7.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-fn_params_layout: Vertical -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-normalize_comments: true +//@ rustfmt-fn_params_layout: Vertical +//@ rustfmt-brace_style: AlwaysNextLine // Case with only one variable. fn foo(a: u8) -> u8 diff --git a/tests/target/fn-custom-8.rs b/tests/target/fn-custom-8.rs index 29af3fca79d..04c9de7a47a 100644 --- a/tests/target/fn-custom-8.rs +++ b/tests/target/fn-custom-8.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine // Test different indents. fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) { diff --git a/tests/target/fn-custom.rs b/tests/target/fn-custom.rs index 506d9de3437..225d0caf9ad 100644 --- a/tests/target/fn-custom.rs +++ b/tests/target/fn-custom.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Compressed +//@ rustfmt-fn_params_layout: Compressed // Test some of the ways function signatures can be customised. // Test compressed layout of args. diff --git a/tests/target/fn-simple.rs b/tests/target/fn-simple.rs index e725269360d..79eaa484933 100644 --- a/tests/target/fn-simple.rs +++ b/tests/target/fn-simple.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn simple( // pre-comment on a function!? diff --git a/tests/target/fn-single-line/version_one.rs b/tests/target/fn-single-line/version_one.rs index 5b704474d6d..c9df3f6300e 100644 --- a/tests/target/fn-single-line/version_one.rs +++ b/tests/target/fn-single-line/version_one.rs @@ -1,5 +1,5 @@ -// rustfmt-fn_single_line: true -// rustfmt-style_edition: 2015 +//@ rustfmt-fn_single_line: true +//@ rustfmt-style_edition: 2015 // Test single-line functions. fn foo_expr() { 1 } diff --git a/tests/target/fn-single-line/version_two.rs b/tests/target/fn-single-line/version_two.rs index aedd1d481b6..e6bcba608bc 100644 --- a/tests/target/fn-single-line/version_two.rs +++ b/tests/target/fn-single-line/version_two.rs @@ -1,5 +1,5 @@ -// rustfmt-fn_single_line: true -// rustfmt-style_edition: 2024 +//@ rustfmt-fn_single_line: true +//@ rustfmt-style_edition: 2024 // Test single-line functions. fn foo_expr() { 1 } diff --git a/tests/target/fn_args_indent-block.rs b/tests/target/fn_args_indent-block.rs index f5232a48817..755188703de 100644 --- a/tests/target/fn_args_indent-block.rs +++ b/tests/target/fn_args_indent-block.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn foo() { foo(); diff --git a/tests/target/fn_args_layout-vertical.rs b/tests/target/fn_args_layout-vertical.rs index bfeca15c967..6aa7d874f06 100644 --- a/tests/target/fn_args_layout-vertical.rs +++ b/tests/target/fn_args_layout-vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-fn_params_layout: Vertical +//@ rustfmt-fn_params_layout: Vertical // Empty list should stay on one line. fn do_bar() -> u8 { diff --git a/tests/target/format_strings/issue-202.rs b/tests/target/format_strings/issue-202.rs index 2a2c24140dd..6ad0d935c44 100644 --- a/tests/target/format_strings/issue-202.rs +++ b/tests/target/format_strings/issue-202.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true #[test] fn compile_empty_program() { diff --git a/tests/target/format_strings/issue-2833.rs b/tests/target/format_strings/issue-2833.rs index 70483532528..a7d24e0a99b 100644 --- a/tests/target/format_strings/issue-2833.rs +++ b/tests/target/format_strings/issue-2833.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 80 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 80 fn test1() { let expected = "\ diff --git a/tests/target/format_strings/issue-3263.rs b/tests/target/format_strings/issue-3263.rs index 72f7e9cc627..a53ca7117fa 100644 --- a/tests/target/format_strings/issue-3263.rs +++ b/tests/target/format_strings/issue-3263.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-newline_style: Windows +//@ rustfmt-format_strings: true +//@ rustfmt-newline_style: Windows #[test] fn compile_empty_program() { diff --git a/tests/target/format_strings/issue-687.rs b/tests/target/format_strings/issue-687.rs index 21d292f9eb9..56ba05f31dc 100644 --- a/tests/target/format_strings/issue-687.rs +++ b/tests/target/format_strings/issue-687.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true fn foo() -> &'static str { let sql = "ATTACH DATABASE ':memory:' AS my_attached; diff --git a/tests/target/format_strings/issue564.rs b/tests/target/format_strings/issue564.rs index d9ef077c256..259229a8a45 100644 --- a/tests/target/format_strings/issue564.rs +++ b/tests/target/format_strings/issue564.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true const USAGE: &'static str = " Usage: codegen project diff --git a/tests/target/hard-tabs.rs b/tests/target/hard-tabs.rs index aca7e09c0ea..452d4ca730d 100644 --- a/tests/target/hard-tabs.rs +++ b/tests/target/hard-tabs.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-hard_tabs: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-hard_tabs: true fn main() { let x = Bar; diff --git a/tests/target/hello.rs b/tests/target/hello.rs index d9f90b0b5e8..67721876608 100644 --- a/tests/target/hello.rs +++ b/tests/target/hello.rs @@ -1,5 +1,5 @@ -// rustfmt-config: small_tabs.toml -// rustfmt-target: hello.rs +//@ rustfmt-config: small_tabs.toml +//@ rustfmt-target: hello.rs // Smoke test - hello world. diff --git a/tests/target/impls.rs b/tests/target/impls.rs index 71dfb5591e7..4be29998e27 100644 --- a/tests/target/impls.rs +++ b/tests/target/impls.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true impl Foo for Bar { fn foo() { "hi" diff --git a/tests/target/imports/imports-reorder.rs b/tests/target/imports/imports-reorder.rs index 84e97c0224f..66ac35a5dfa 100644 --- a/tests/target/imports/imports-reorder.rs +++ b/tests/target/imports/imports-reorder.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true use path::{self /* self */, /* A */ A, B /* B */, C}; diff --git a/tests/target/imports/imports.rs b/tests/target/imports/imports.rs index 87584d89f66..8c0ed1d8d7d 100644 --- a/tests/target/imports/imports.rs +++ b/tests/target/imports/imports.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Imports. diff --git a/tests/target/imports/imports_2021_edition.rs b/tests/target/imports/imports_2021_edition.rs index 34dcc866a0b..4208fe49db4 100644 --- a/tests/target/imports/imports_2021_edition.rs +++ b/tests/target/imports/imports_2021_edition.rs @@ -1,3 +1,3 @@ -// rustfmt-edition: 2021 +//@ rustfmt-edition: 2021 use ::happy::new::year; diff --git a/tests/target/imports/imports_granularity_crate.rs b/tests/target/imports/imports_granularity_crate.rs index 36e01558ff0..d571a1bf6d9 100644 --- a/tests/target/imports/imports_granularity_crate.rs +++ b/tests/target/imports/imports_granularity_crate.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Crate +//@ rustfmt-imports_granularity: Crate use a::{a, b, c, d, e, f, g}; diff --git a/tests/target/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs b/tests/target/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs index ed4df544d6f..49079063c81 100644 --- a/tests/target/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs +++ b/tests/target/imports/imports_granularity_item-with-dups-StdExternalCrate-no-reorder.rs @@ -1,6 +1,6 @@ -// rustfmt-imports_granularity: Item -// rustfmt-reorder_imports: false -// rustfmt-group_imports: StdExternalCrate +//@ rustfmt-imports_granularity: Item +//@ rustfmt-reorder_imports: false +//@ rustfmt-group_imports: StdExternalCrate use crate::lexer; use crate::lexer::tokens::TokenData; diff --git a/tests/target/imports/imports_granularity_item-with-dups.rs b/tests/target/imports/imports_granularity_item-with-dups.rs index 00df37f9332..9bd270bcbd1 100644 --- a/tests/target/imports/imports_granularity_item-with-dups.rs +++ b/tests/target/imports/imports_granularity_item-with-dups.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Item +//@ rustfmt-imports_granularity: Item use crate::lexer; use crate::lexer::tokens::TokenData; diff --git a/tests/target/imports/imports_granularity_item.rs b/tests/target/imports/imports_granularity_item.rs index d2f5496fdac..0dc5252cde0 100644 --- a/tests/target/imports/imports_granularity_item.rs +++ b/tests/target/imports/imports_granularity_item.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Item +//@ rustfmt-imports_granularity: Item use a::b; use a::c; diff --git a/tests/target/imports/imports_granularity_module.rs b/tests/target/imports/imports_granularity_module.rs index 23d5cc1503d..1baf402a999 100644 --- a/tests/target/imports/imports_granularity_module.rs +++ b/tests/target/imports/imports_granularity_module.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Module +//@ rustfmt-imports_granularity: Module use a::b::c; use a::d::e; diff --git a/tests/target/imports/imports_granularity_one.rs b/tests/target/imports/imports_granularity_one.rs index da4c6678db1..a3b1aa0eb94 100644 --- a/tests/target/imports/imports_granularity_one.rs +++ b/tests/target/imports/imports_granularity_one.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: One +//@ rustfmt-imports_granularity: One use { a::{ diff --git a/tests/target/imports_raw_identifiers/version_One.rs b/tests/target/imports_raw_identifiers/version_One.rs index bc4b5b13569..852f6b3facd 100644 --- a/tests/target/imports_raw_identifiers/version_One.rs +++ b/tests/target/imports_raw_identifiers/version_One.rs @@ -1,4 +1,4 @@ -// rustfmt-version:One +//@ rustfmt-version:One use websocket::client::ClientBuilder; use websocket::r#async::futures::Stream; diff --git a/tests/target/imports_raw_identifiers/version_Two.rs b/tests/target/imports_raw_identifiers/version_Two.rs index 22bfe93122f..8f8f21627b5 100644 --- a/tests/target/imports_raw_identifiers/version_Two.rs +++ b/tests/target/imports_raw_identifiers/version_Two.rs @@ -1,4 +1,4 @@ -// rustfmt-version:Two +//@ rustfmt-version:Two use websocket::r#async::futures::Stream; use websocket::client::ClientBuilder; diff --git a/tests/target/indented-impl.rs b/tests/target/indented-impl.rs index eff579dddac..c1e217bf1d9 100644 --- a/tests/target/indented-impl.rs +++ b/tests/target/indented-impl.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine mod x { struct X(i8); diff --git a/tests/target/invalid-rust-code-in-doc-comment.rs b/tests/target/invalid-rust-code-in-doc-comment.rs index f8479d4e345..09608c6748d 100644 --- a/tests/target/invalid-rust-code-in-doc-comment.rs +++ b/tests/target/invalid-rust-code-in-doc-comment.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// ```rust /// if (true) { … } diff --git a/tests/target/issue-1021.rs b/tests/target/issue-1021.rs index ba1029d4e61..df4de8c7fd4 100644 --- a/tests/target/issue-1021.rs +++ b/tests/target/issue-1021.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { match x { S(true, .., true) => (), diff --git a/tests/target/issue-1120.rs b/tests/target/issue-1120.rs index f44597e7d1e..b3f89406ad1 100644 --- a/tests/target/issue-1120.rs +++ b/tests/target/issue-1120.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: true +//@ rustfmt-reorder_imports: true // Ensure that a use at the start of an inline module is correctly formatted. mod foo { diff --git a/tests/target/issue-1124.rs b/tests/target/issue-1124.rs index f0fc485a3c2..b54fd4b3522 100644 --- a/tests/target/issue-1124.rs +++ b/tests/target/issue-1124.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: true +//@ rustfmt-reorder_imports: true use a; use b; diff --git a/tests/target/issue-1127.rs b/tests/target/issue-1127.rs index fb09036d1f8..fe62d4d9895 100644 --- a/tests/target/issue-1127.rs +++ b/tests/target/issue-1127.rs @@ -1,6 +1,6 @@ -// rustfmt-max_width: 120 -// rustfmt-match_arm_blocks: false -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-max_width: 120 +//@ rustfmt-match_arm_blocks: false +//@ rustfmt-match_block_trailing_comma: true fn a_very_very_very_very_very_very_very_very_very_very_very_long_function_name() -> i32 { 42 diff --git a/tests/target/issue-1177.rs b/tests/target/issue-1177.rs index dcda3972814..edb67842ad3 100644 --- a/tests/target/issue-1177.rs +++ b/tests/target/issue-1177.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { // Line Comment // Block Comment diff --git a/tests/target/issue-1210/a.rs b/tests/target/issue-1210/a.rs index 94c1b44e5e5..135deb66230 100644 --- a/tests/target/issue-1210/a.rs +++ b/tests/target/issue-1210/a.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 impl Foo { fn cxx(&self, target: &str) -> &Path { diff --git a/tests/target/issue-1210/b.rs b/tests/target/issue-1210/b.rs index a7b1e3bcdc8..dba7fd6e6f2 100644 --- a/tests/target/issue-1210/b.rs +++ b/tests/target/issue-1210/b.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 impl Foo { fn cxx(&self, target: &str) -> &Path { diff --git a/tests/target/issue-1210/c.rs b/tests/target/issue-1210/c.rs index 183d79f9258..fae0043b6e9 100644 --- a/tests/target/issue-1210/c.rs +++ b/tests/target/issue-1210/c.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 const foo: String = "trailing_spaces!! diff --git a/tests/target/issue-1210/d.rs b/tests/target/issue-1210/d.rs index 9279e6fc999..7b33d7c2c39 100644 --- a/tests/target/issue-1210/d.rs +++ b/tests/target/issue-1210/d.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // trailing_spaces_in_comment!! // remove those from above diff --git a/tests/target/issue-1210/e.rs b/tests/target/issue-1210/e.rs index 55f80c6c3cc..16680c68afc 100644 --- a/tests/target/issue-1210/e.rs +++ b/tests/target/issue-1210/e.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 50 +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 50 // explicit line breaks should be kept in order to preserve the layout diff --git a/tests/target/issue-1216.rs b/tests/target/issue-1216.rs index d727c158ab8..896df187767 100644 --- a/tests/target/issue-1216.rs +++ b/tests/target/issue-1216.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true enum E { A, //* I am not a block comment (caused panic) B, diff --git a/tests/target/issue-1247.rs b/tests/target/issue-1247.rs index 16c63e0f53d..f1f833c6295 100644 --- a/tests/target/issue-1247.rs +++ b/tests/target/issue-1247.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 fn foo() { polyfill::slice::fill( diff --git a/tests/target/issue-1278.rs b/tests/target/issue-1278.rs index b7e636f1a27..bff29d14045 100644 --- a/tests/target/issue-1278.rs +++ b/tests/target/issue-1278.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Block +//@ rustfmt-indent_style: Block #![feature(pub_restricted)] diff --git a/tests/target/issue-1350.rs b/tests/target/issue-1350.rs index 2cf65509c93..7a48d196e67 100644 --- a/tests/target/issue-1350.rs +++ b/tests/target/issue-1350.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 120 -// rustfmt-comment_width: 110 +//@ rustfmt-max_width: 120 +//@ rustfmt-comment_width: 110 impl Struct { fn fun() { diff --git a/tests/target/issue-1681.rs b/tests/target/issue-1681.rs index 902765302ea..bdf38cfd751 100644 --- a/tests/target/issue-1681.rs +++ b/tests/target/issue-1681.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 // We would like to surround closure body with block when overflowing the last // argument of function call if the last argument has condition and without diff --git a/tests/target/issue-1802.rs b/tests/target/issue-1802.rs index ef7ee891059..c6512ce34b4 100644 --- a/tests/target/issue-1802.rs +++ b/tests/target/issue-1802.rs @@ -1,5 +1,5 @@ -// rustfmt-tab_spaces: 2 -// rustfmt-max_width: 30 +//@ rustfmt-tab_spaces: 2 +//@ rustfmt-max_width: 30 enum F { X { diff --git a/tests/target/issue-1914.rs b/tests/target/issue-1914.rs index d2d532af1dc..c5757657f87 100644 --- a/tests/target/issue-1914.rs +++ b/tests/target/issue-1914.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 extern "C" { #[link_name = "_ZN7MyClass26example_check_no_collisionE"] diff --git a/tests/target/issue-2123.rs b/tests/target/issue-2123.rs index 5e9917b4023..a41693404f3 100644 --- a/tests/target/issue-2123.rs +++ b/tests/target/issue-2123.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //hello //world diff --git a/tests/target/issue-2179/one.rs b/tests/target/issue-2179/one.rs index 6593624e589..b3ceaf31e3d 100644 --- a/tests/target/issue-2179/one.rs +++ b/tests/target/issue-2179/one.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2015 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-style_edition: 2015 +//@ rustfmt-error_on_line_overflow: false fn issue_2179() { let (opts, rustflags, clear_env_rust_log) = { diff --git a/tests/target/issue-2179/two.rs b/tests/target/issue-2179/two.rs index 088518705fe..c8dcf6fed1f 100644 --- a/tests/target/issue-2179/two.rs +++ b/tests/target/issue-2179/two.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-error_on_line_overflow: false +//@ rustfmt-style_edition: 2024 +//@ rustfmt-error_on_line_overflow: false fn issue_2179() { let (opts, rustflags, clear_env_rust_log) = { diff --git a/tests/target/issue-2197.rs b/tests/target/issue-2197.rs index d42c08e19db..f64fc563dfe 100644 --- a/tests/target/issue-2197.rs +++ b/tests/target/issue-2197.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 79 -// rustfmt-wrap_comments: true +//@ rustfmt-max_width: 79 +//@ rustfmt-wrap_comments: true /// ```rust /// unsafe fn sum_sse2(x: i32x4) -> i32 { diff --git a/tests/target/issue-2342.rs b/tests/target/issue-2342.rs index f9c26857e15..fb488ad1a1c 100644 --- a/tests/target/issue-2342.rs +++ b/tests/target/issue-2342.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 struct Foo { #[cfg(feature = "serde")] diff --git a/tests/target/issue-2346.rs b/tests/target/issue-2346.rs index 07817221a51..e623b9d6826 100644 --- a/tests/target/issue-2346.rs +++ b/tests/target/issue-2346.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // the following empty comment should not have any trailing space added. // fn main() {} diff --git a/tests/target/issue-2401.rs b/tests/target/issue-2401.rs index ec8f27b732f..2e118d19d9e 100644 --- a/tests/target/issue-2401.rs +++ b/tests/target/issue-2401.rs @@ -1,5 +1,5 @@ -// rustfmt-hard_tabs = true -// rustfmt-normalize_comments = true +//@ rustfmt-hard_tabs: true +//@ rustfmt-normalize_comments: true /// ``` /// println!("Hello, World!"); diff --git a/tests/target/issue-2482/a.rs b/tests/target/issue-2482/a.rs index fbbcb52a878..f0b3ab82a02 100644 --- a/tests/target/issue-2482/a.rs +++ b/tests/target/issue-2482/a.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_modules: true +//@ rustfmt-reorder_modules: true // Do not reorder inline modules. diff --git a/tests/target/issue-2496.rs b/tests/target/issue-2496.rs index 60c4f55ddff..cc90817eb3c 100644 --- a/tests/target/issue-2496.rs +++ b/tests/target/issue-2496.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { match option { None => some_function(first_reasonably_long_argument, diff --git a/tests/target/issue-2520.rs b/tests/target/issue-2520.rs index 7c134d3972b..77a481f6f25 100644 --- a/tests/target/issue-2520.rs +++ b/tests/target/issue-2520.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_code_in_doc_comments: true //! ```rust //! println!("hello, world"); diff --git a/tests/target/issue-2523.rs b/tests/target/issue-2523.rs index 612f93249ac..2a299597023 100644 --- a/tests/target/issue-2523.rs +++ b/tests/target/issue-2523.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_code_in_doc_comments: true // Do not unindent macro calls in comment with unformattable syntax. //! ```rust diff --git a/tests/target/issue-2534/format_macro_matchers_false.rs b/tests/target/issue-2534/format_macro_matchers_false.rs index 2038ed7f1d0..9f18c7ba746 100644 --- a/tests/target/issue-2534/format_macro_matchers_false.rs +++ b/tests/target/issue-2534/format_macro_matchers_false.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: false +//@ rustfmt-format_macro_matchers: false macro_rules! foo { ($a:ident : $b:ty) => {}; diff --git a/tests/target/issue-2534/format_macro_matchers_true.rs b/tests/target/issue-2534/format_macro_matchers_true.rs index 01d939add4d..718d7895e11 100644 --- a/tests/target/issue-2534/format_macro_matchers_true.rs +++ b/tests/target/issue-2534/format_macro_matchers_true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: true +//@ rustfmt-format_macro_matchers: true macro_rules! foo { ($a:ident : $b:ty) => {}; diff --git a/tests/target/issue-2644.rs b/tests/target/issue-2644.rs index a87e4c0b4fe..4f399fa763c 100644 --- a/tests/target/issue-2644.rs +++ b/tests/target/issue-2644.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 80 +//@ rustfmt-max_width: 80 fn foo(e: Enum) { match e { Enum::Var { element1, element2 } => { diff --git a/tests/target/issue-2673-nonmodrs-mods/foo.rs b/tests/target/issue-2673-nonmodrs-mods/foo.rs index 5340816d61e..b89e23e6e8e 100644 --- a/tests/target/issue-2673-nonmodrs-mods/foo.rs +++ b/tests/target/issue-2673-nonmodrs-mods/foo.rs @@ -1,4 +1,4 @@ -// rustfmt-config: skip_children.toml +//@ rustfmt-config: skip_children.toml mod bar; mod baz {} diff --git a/tests/target/issue-2728.rs b/tests/target/issue-2728.rs index 6cb41b75b6d..24d9af4fd34 100644 --- a/tests/target/issue-2728.rs +++ b/tests/target/issue-2728.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-newline_style: Windows +//@ rustfmt-wrap_comments: true +//@ rustfmt-newline_style: Windows //! ```rust //! extern crate uom; diff --git a/tests/target/issue-2759.rs b/tests/target/issue-2759.rs index b7176ec66f8..cd854e51f6f 100644 --- a/tests/target/issue-2759.rs +++ b/tests/target/issue-2759.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 89 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 89 // Code block in doc comments that will exceed max width. /// ```rust diff --git a/tests/target/issue-2794.rs b/tests/target/issue-2794.rs index 951c0af206d..2d2f9bb88c0 100644 --- a/tests/target/issue-2794.rs +++ b/tests/target/issue-2794.rs @@ -1,6 +1,6 @@ -// rustfmt-indent_style: Block -// rustfmt-imports_indent: Block -// rustfmt-imports_layout: Vertical +//@ rustfmt-indent_style: Block +//@ rustfmt-imports_indent: Block +//@ rustfmt-imports_layout: Vertical use std::{ env, diff --git a/tests/target/issue-2810.rs b/tests/target/issue-2810.rs index 34140c7a1fc..79d3f194617 100644 --- a/tests/target/issue-2810.rs +++ b/tests/target/issue-2810.rs @@ -1,4 +1,4 @@ -// rustfmt-newline_style: Windows +//@ rustfmt-newline_style: Windows #[macro_export] macro_rules! hmmm___ffi_error { diff --git a/tests/target/issue-2835.rs b/tests/target/issue-2835.rs index 21e8ce41145..bb6dc3d0a60 100644 --- a/tests/target/issue-2835.rs +++ b/tests/target/issue-2835.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine -// rustfmt-fn_single_line: true +//@ rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-fn_single_line: true fn lorem() -> i32 { 42 } diff --git a/tests/target/issue-2863.rs b/tests/target/issue-2863.rs index 35a80f7a621..5862ba670b0 100644 --- a/tests/target/issue-2863.rs +++ b/tests/target/issue-2863.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: true +//@ rustfmt-reorder_impl_items: true impl IntoIterator for SafeVec { type Bar = u32; diff --git a/tests/target/issue-2869.rs b/tests/target/issue-2869.rs index 6a68c2d95fa..30473d814f9 100644 --- a/tests/target/issue-2869.rs +++ b/tests/target/issue-2869.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 50 +//@ rustfmt-struct_field_align_threshold: 50 #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "PascalCase")] diff --git a/tests/target/issue-2917/packed_simd.rs b/tests/target/issue-2917/packed_simd.rs index 274614f83e2..3abdba0261c 100644 --- a/tests/target/issue-2917/packed_simd.rs +++ b/tests/target/issue-2917/packed_simd.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! Implements `From` and `Into` for vector types. macro_rules! impl_from_vector { diff --git a/tests/target/issue-2922.rs b/tests/target/issue-2922.rs index 501f78c78b8..221c89099b8 100644 --- a/tests/target/issue-2922.rs +++ b/tests/target/issue-2922.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual struct Functions { RunListenServer: unsafe extern "C" fn(*mut c_void, *mut c_char, diff --git a/tests/target/issue-2927-2.rs b/tests/target/issue-2927-2.rs index 46e0bf0e989..19167463d14 100644 --- a/tests/target/issue-2927-2.rs +++ b/tests/target/issue-2927-2.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2015 +//@ rustfmt-edition: 2015 #![feature(uniform_paths)] use futures::prelude::*; use http_03::cli::Cli; diff --git a/tests/target/issue-2927.rs b/tests/target/issue-2927.rs index 56afc2d3e40..c2e52151428 100644 --- a/tests/target/issue-2927.rs +++ b/tests/target/issue-2927.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(uniform_paths)] use ::log::{error, info, log}; use futures::prelude::*; diff --git a/tests/target/issue-2930.rs b/tests/target/issue-2930.rs index 41e763a7c08..9a4a59c1a3e 100644 --- a/tests/target/issue-2930.rs +++ b/tests/target/issue-2930.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { let (first_variable, second_variable) = (this_is_something_with_an_extraordinarily_long_name, this_variable_name_is_also_pretty_long); diff --git a/tests/target/issue-2941.rs b/tests/target/issue-2941.rs index 3c6c702c2ae..427d038ab0b 100644 --- a/tests/target/issue-2941.rs +++ b/tests/target/issue-2941.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! ``` //! \ diff --git a/tests/target/issue-2955.rs b/tests/target/issue-2955.rs index 799cd36e29a..5de73e29299 100644 --- a/tests/target/issue-2955.rs +++ b/tests/target/issue-2955.rs @@ -1,4 +1,4 @@ -// rustfmt-condense_wildcard_suffixes: true +//@ rustfmt-condense_wildcard_suffixes: true fn main() { match (1, 2, 3) { (..) => (), diff --git a/tests/target/issue-2985.rs b/tests/target/issue-2985.rs index faad859236d..74e5d60469b 100644 --- a/tests/target/issue-2985.rs +++ b/tests/target/issue-2985.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn foo() { { { diff --git a/tests/target/issue-3043.rs b/tests/target/issue-3043.rs index b54e244a401..44ab61e7108 100644 --- a/tests/target/issue-3043.rs +++ b/tests/target/issue-3043.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 use ::std::vec::Vec; diff --git a/tests/target/issue-3049.rs b/tests/target/issue-3049.rs index fad15435433..332fbcbe106 100644 --- a/tests/target/issue-3049.rs +++ b/tests/target/issue-3049.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { something.aaaaaaaaaaaa() .aaaaaaaaaaaa() diff --git a/tests/target/issue-3055/backtick.rs b/tests/target/issue-3055/backtick.rs index f5bae8d3db4..3a52d248919 100644 --- a/tests/target/issue-3055/backtick.rs +++ b/tests/target/issue-3055/backtick.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Simple block /// diff --git a/tests/target/issue-3055/empty-code-block.rs b/tests/target/issue-3055/empty-code-block.rs index 566f7ef9b6e..1a88ee24afa 100644 --- a/tests/target/issue-3055/empty-code-block.rs +++ b/tests/target/issue-3055/empty-code-block.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Simple block /// diff --git a/tests/target/issue-3055/original.rs b/tests/target/issue-3055/original.rs index 2df6adbb5e2..c2e4a803053 100644 --- a/tests/target/issue-3055/original.rs +++ b/tests/target/issue-3055/original.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc /// commodo ultricies dui. diff --git a/tests/target/issue-3059.rs b/tests/target/issue-3059.rs index f750c128759..6111b5e37b3 100644 --- a/tests/target/issue-3059.rs +++ b/tests/target/issue-3059.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 80 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 80 /// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc /// commodo ultricies dui. Cras gravida rutrum massa. Donec accumsan mattis diff --git a/tests/target/issue-3066.rs b/tests/target/issue-3066.rs index d4dccc97e48..eaf6c9343c8 100644 --- a/tests/target/issue-3066.rs +++ b/tests/target/issue-3066.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn main() { Struct { field: aaaaaaaaaaa }; Struct { field: aaaaaaaaaaaa }; diff --git a/tests/target/issue-3105.rs b/tests/target/issue-3105.rs index 4f1123805b8..a57811f7a9a 100644 --- a/tests/target/issue-3105.rs +++ b/tests/target/issue-3105.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Although the indentation of the skipped method is off, it shouldn't be /// changed. diff --git a/tests/target/issue-3132.rs b/tests/target/issue-3132.rs index 4d61baa7507..e012bde11cc 100644 --- a/tests/target/issue-3132.rs +++ b/tests/target/issue-3132.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn test() { /* diff --git a/tests/target/issue-3153.rs b/tests/target/issue-3153.rs index 39e569c0d54..95800a54236 100644 --- a/tests/target/issue-3153.rs +++ b/tests/target/issue-3153.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// This may panic if: /// - there are fewer than `max_header_bytes` bytes preceding the body diff --git a/tests/target/issue-3158.rs b/tests/target/issue-3158.rs index 4bbbdc1d039..b805e5e7e5e 100644 --- a/tests/target/issue-3158.rs +++ b/tests/target/issue-3158.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// Should format /// ```rust diff --git a/tests/target/issue-3182.rs b/tests/target/issue-3182.rs index d8de8443812..e4a37ad009a 100644 --- a/tests/target/issue-3182.rs +++ b/tests/target/issue-3182.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 79 -// rustfmt-wrap_comments: true +//@ rustfmt-max_width: 79 +//@ rustfmt-wrap_comments: true /// ```rust /// # #![cfg_attr(not(dox), feature(cfg_target_feature, target_feature, stdsimd)not(dox), feature(cfg_target_feature, target_feature, stdsimd))] diff --git a/tests/target/issue-3213/version_one.rs b/tests/target/issue-3213/version_one.rs index a20915df761..81c566f06bd 100644 --- a/tests/target/issue-3213/version_one.rs +++ b/tests/target/issue-3213/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn foo() { match 0 { diff --git a/tests/target/issue-3213/version_two.rs b/tests/target/issue-3213/version_two.rs index fb609f6a67a..269c0bc1126 100644 --- a/tests/target/issue-3213/version_two.rs +++ b/tests/target/issue-3213/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn foo() { match 0 { diff --git a/tests/target/issue-3224.rs b/tests/target/issue-3224.rs index 6476d2117c6..8c029d4cf94 100644 --- a/tests/target/issue-3224.rs +++ b/tests/target/issue-3224.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! Test: //! * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/tests/target/issue-3227/one.rs b/tests/target/issue-3227/one.rs index 2922bfdfef7..c1b57e3993a 100644 --- a/tests/target/issue-3227/one.rs +++ b/tests/target/issue-3227/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn main() { thread::spawn(|| { diff --git a/tests/target/issue-3227/two.rs b/tests/target/issue-3227/two.rs index ae7eee47194..d580f79f384 100644 --- a/tests/target/issue-3227/two.rs +++ b/tests/target/issue-3227/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { thread::spawn(|| { diff --git a/tests/target/issue-3241.rs b/tests/target/issue-3241.rs index 60b452abdde..87bfbbb5052 100644 --- a/tests/target/issue-3241.rs +++ b/tests/target/issue-3241.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 use ::baz::{bar, foo}; use ::ignore; diff --git a/tests/target/issue-3265.rs b/tests/target/issue-3265.rs index 7db1dbd8b73..b3c4bb60d9a 100644 --- a/tests/target/issue-3265.rs +++ b/tests/target/issue-3265.rs @@ -1,4 +1,4 @@ -// rustfmt-newline_style: Windows +//@ rustfmt-newline_style: Windows #[cfg(test)] mod test { summary_test! { diff --git a/tests/target/issue-3270/one.rs b/tests/target/issue-3270/one.rs index a31a0ff5742..286288b7534 100644 --- a/tests/target/issue-3270/one.rs +++ b/tests/target/issue-3270/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 pub fn main() { /* let s = String::from( diff --git a/tests/target/issue-3270/two.rs b/tests/target/issue-3270/two.rs index 8e26f8ac23d..17652191859 100644 --- a/tests/target/issue-3270/two.rs +++ b/tests/target/issue-3270/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub fn main() { /* let s = String::from( diff --git a/tests/target/issue-3270/wrap.rs b/tests/target/issue-3270/wrap.rs index 967bfb5534c..d22c0f51b74 100644 --- a/tests/target/issue-3270/wrap.rs +++ b/tests/target/issue-3270/wrap.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-style_edition: 2024 +//@ rustfmt-wrap_comments: true +//@ rustfmt-style_edition: 2024 // check that a line below max_width does not get over the limit when wrapping // it in a block comment diff --git a/tests/target/issue-3272/v1.rs b/tests/target/issue-3272/v1.rs index 7cca7ea7896..abf580148f0 100644 --- a/tests/target/issue-3272/v1.rs +++ b/tests/target/issue-3272/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn main() { assert!(HAYSTACK diff --git a/tests/target/issue-3272/v2.rs b/tests/target/issue-3272/v2.rs index ca7718c5a61..f5d9374b7cf 100644 --- a/tests/target/issue-3272/v2.rs +++ b/tests/target/issue-3272/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { assert!( diff --git a/tests/target/issue-3278/version_one.rs b/tests/target/issue-3278/version_one.rs index 718a32b4c7e..978234326c8 100644 --- a/tests/target/issue-3278/version_one.rs +++ b/tests/target/issue-3278/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 pub fn parse_conditional<'a, I: 'a>( ) -> impl Parser + 'a diff --git a/tests/target/issue-3278/version_two.rs b/tests/target/issue-3278/version_two.rs index eb605e509f9..a0ed3ede1fe 100644 --- a/tests/target/issue-3278/version_two.rs +++ b/tests/target/issue-3278/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub fn parse_conditional<'a, I: 'a>() -> impl Parser + 'a diff --git a/tests/target/issue-3295/two.rs b/tests/target/issue-3295/two.rs index 4f685172cfa..46f611244a8 100644 --- a/tests/target/issue-3295/two.rs +++ b/tests/target/issue-3295/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub enum TestEnum { a, b, diff --git a/tests/target/issue-3302.rs b/tests/target/issue-3302.rs index 504bfd987f5..a53d39bbb98 100644 --- a/tests/target/issue-3302.rs +++ b/tests/target/issue-3302.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 macro_rules! moo1 { () => { diff --git a/tests/target/issue-3304.rs b/tests/target/issue-3304.rs index cc1910ce257..c844a9a7b71 100644 --- a/tests/target/issue-3304.rs +++ b/tests/target/issue-3304.rs @@ -1,4 +1,4 @@ -// rustfmt-error_on_line_overflow: true +//@ rustfmt-error_on_line_overflow: true #[rustfmt::skip] use one::two::three::four::five::six::seven::eight::night::ten::eleven::twelve::thirteen::fourteen::fiveteen; #[rustfmt::skip] diff --git a/tests/target/issue-3343.rs b/tests/target/issue-3343.rs index d0497758e66..fe92ec09b17 100644 --- a/tests/target/issue-3343.rs +++ b/tests/target/issue-3343.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 50 +//@ rustfmt-inline_attribute_width: 50 #[cfg(feature = "alloc")] use core::slice; diff --git a/tests/target/issue-3442.rs b/tests/target/issue-3442.rs index 3664c50ee7a..80a4639e218 100644 --- a/tests/target/issue-3442.rs +++ b/tests/target/issue-3442.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/target/issue-3442.rs","range":[5,5]},{"file":"tests/target/issue-3442.rs","range":[8,8]}] +//@ rustfmt-file_lines: [{"file":"tests/target/issue-3442.rs","range":[5,5]},{"file":"tests/target/issue-3442.rs","range":[8,8]}] extern crate alpha; // comment 1 extern crate beta; // comment 2 diff --git a/tests/target/issue-3494/crlf.rs b/tests/target/issue-3494/crlf.rs index cae615a0666..1984cc535e9 100644 --- a/tests/target/issue-3494/crlf.rs +++ b/tests/target/issue-3494/crlf.rs @@ -1,8 +1,8 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-3494/crlf.rs","range":[4,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-3494/crlf.rs","range":[4,5]}] -pub fn main() { +pub fn main() { let world1 = "world"; - println!("Hello, {}!", world1); -let world2 = "world"; println!("Hello, {}!", world2); -let world3 = "world"; println!("Hello, {}!", world3); -} + println!("Hello, {}!", world1); +let world2 = "world"; println!("Hello, {}!", world2); +let world3 = "world"; println!("Hello, {}!", world3); +} diff --git a/tests/target/issue-3494/lf.rs b/tests/target/issue-3494/lf.rs index 60aafe19a02..52832f5cf27 100644 --- a/tests/target/issue-3494/lf.rs +++ b/tests/target/issue-3494/lf.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-3494/lf.rs","range":[4,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-3494/lf.rs","range":[4,5]}] pub fn main() { let world1 = "world"; diff --git a/tests/target/issue-3515.rs b/tests/target/issue-3515.rs index b59d03c6c82..3d39a86c418 100644 --- a/tests/target/issue-3515.rs +++ b/tests/target/issue-3515.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_imports: false +//@ rustfmt-reorder_imports: false use std::fmt::{self, Display}; use std::collections::HashMap; diff --git a/tests/target/issue-3585/extern_crate.rs b/tests/target/issue-3585/extern_crate.rs index dc7c9e0246b..63b287488d0 100644 --- a/tests/target/issue-3585/extern_crate.rs +++ b/tests/target/issue-3585/extern_crate.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 100 +//@ rustfmt-inline_attribute_width: 100 #[macro_use] extern crate static_assertions; diff --git a/tests/target/issue-3585/reorder_imports_disabled.rs b/tests/target/issue-3585/reorder_imports_disabled.rs index f9637729b7e..835f585ef61 100644 --- a/tests/target/issue-3585/reorder_imports_disabled.rs +++ b/tests/target/issue-3585/reorder_imports_disabled.rs @@ -1,5 +1,5 @@ -// rustfmt-inline_attribute_width: 100 -// rustfmt-reorder_imports: false +//@ rustfmt-inline_attribute_width: 100 +//@ rustfmt-reorder_imports: false #[cfg(unix)] extern crate crateb; #[cfg(unix)] extern crate cratea; diff --git a/tests/target/issue-3585/reorder_imports_enabled.rs b/tests/target/issue-3585/reorder_imports_enabled.rs index d040d0ed341..34551b0cc73 100644 --- a/tests/target/issue-3585/reorder_imports_enabled.rs +++ b/tests/target/issue-3585/reorder_imports_enabled.rs @@ -1,5 +1,5 @@ -// rustfmt-inline_attribute_width: 100 -// rustfmt-reorder_imports: true +//@ rustfmt-inline_attribute_width: 100 +//@ rustfmt-reorder_imports: true #[cfg(unix)] extern crate cratea; #[cfg(unix)] extern crate crateb; diff --git a/tests/target/issue-3585/use.rs b/tests/target/issue-3585/use.rs index c76a9eaacc8..6d0236290de 100644 --- a/tests/target/issue-3585/use.rs +++ b/tests/target/issue-3585/use.rs @@ -1,4 +1,4 @@ -// rustfmt-inline_attribute_width: 100 +//@ rustfmt-inline_attribute_width: 100 #[macro_use] use static_assertions; diff --git a/tests/target/issue-3614/version_one.rs b/tests/target/issue-3614/version_one.rs index 4bd972aa87a..1456ece100c 100644 --- a/tests/target/issue-3614/version_one.rs +++ b/tests/target/issue-3614/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn main() { let toto = || { diff --git a/tests/target/issue-3614/version_two.rs b/tests/target/issue-3614/version_two.rs index 7b9534caa02..1a60b02c188 100644 --- a/tests/target/issue-3614/version_two.rs +++ b/tests/target/issue-3614/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { let toto = || { diff --git a/tests/target/issue-3636.rs b/tests/target/issue-3636.rs index d467ed7389f..90df3bb36a4 100644 --- a/tests/target/issue-3636.rs +++ b/tests/target/issue-3636.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-3636.rs","range":[4,7]},{"file":"tests/target/issue-3636.rs","range":[3,6]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-3636.rs","range":[4,7]},{"file":"tests/target/issue-3636.rs","range":[3,6]}] fn foo() { let x = 42; diff --git a/tests/target/issue-3701/one.rs b/tests/target/issue-3701/one.rs index b154724d341..5e5fdfc41a6 100644 --- a/tests/target/issue-3701/one.rs +++ b/tests/target/issue-3701/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/target/issue-3701/two.rs b/tests/target/issue-3701/two.rs index 995763ef291..7f521fd39b6 100644 --- a/tests/target/issue-3701/two.rs +++ b/tests/target/issue-3701/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/target/issue-3709.rs b/tests/target/issue-3709.rs index 0f3eae048d4..77b2b3acf00 100644 --- a/tests/target/issue-3709.rs +++ b/tests/target/issue-3709.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 macro_rules! token { ($t:tt) => {}; diff --git a/tests/target/issue-3750.rs b/tests/target/issue-3750.rs index 6875f8d3897..9f0d935bd94 100644 --- a/tests/target/issue-3750.rs +++ b/tests/target/issue-3750.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Crate +//@ rustfmt-imports_granularity: Crate pub mod foo { pub mod bar { diff --git a/tests/target/issue-3751.rs b/tests/target/issue-3751.rs index e5a03956e9d..bdc53beb148 100644 --- a/tests/target/issue-3751.rs +++ b/tests/target/issue-3751.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true //! Empty pound line //! diff --git a/tests/target/issue-3779/lib.rs b/tests/target/issue-3779/lib.rs index a5673a4db7e..a11be9fae4b 100644 --- a/tests/target/issue-3779/lib.rs +++ b/tests/target/issue-3779/lib.rs @@ -1,5 +1,5 @@ -// rustfmt-unstable: true -// rustfmt-config: issue-3779.toml +//@ rustfmt-unstable: true +//@ rustfmt-config: issue-3779.toml #[path = "ice.rs"] mod ice; diff --git a/tests/target/issue-3787.rs b/tests/target/issue-3787.rs index 32cf7e3d755..b0f7b15156a 100644 --- a/tests/target/issue-3787.rs +++ b/tests/target/issue-3787.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! URLs in items //! * [This is a link with a very loooooooooooooooooooooooooooooooooooooooooong URL.](https://example.com/This/is/a/link/with/a/very/loooooooooooooooooooooooooooooooooooooooooong/URL) diff --git a/tests/target/issue-3805.rs b/tests/target/issue-3805.rs index a1eda832d76..a484adc371d 100644 --- a/tests/target/issue-3805.rs +++ b/tests/target/issue-3805.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-format_macro_matchers: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-format_macro_matchers: true // From original issue example - Line length 101 macro_rules! test { diff --git a/tests/target/issue-3840/version-one_hard-tabs.rs b/tests/target/issue-3840/version-one_hard-tabs.rs index 4aa905ce9e5..3c40bb32c1f 100644 --- a/tests/target/issue-3840/version-one_hard-tabs.rs +++ b/tests/target/issue-3840/version-one_hard-tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true impl< Target: FromEvent + FromEvent, diff --git a/tests/target/issue-3840/version-two_hard-tabs.rs b/tests/target/issue-3840/version-two_hard-tabs.rs index 78a2f921735..8655c0a9ac1 100644 --- a/tests/target/issue-3840/version-two_hard-tabs.rs +++ b/tests/target/issue-3840/version-two_hard-tabs.rs @@ -1,5 +1,5 @@ -// rustfmt-hard_tabs: true -// rustfmt-style_edition: 2024 +//@ rustfmt-hard_tabs: true +//@ rustfmt-style_edition: 2024 impl< Target: FromEvent + FromEvent, diff --git a/tests/target/issue-3840/version-two_soft-tabs.rs b/tests/target/issue-3840/version-two_soft-tabs.rs index c76dd4dafbb..56334e05d33 100644 --- a/tests/target/issue-3840/version-two_soft-tabs.rs +++ b/tests/target/issue-3840/version-two_soft-tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 impl< Target: FromEvent + FromEvent, diff --git a/tests/target/issue-3882.rs b/tests/target/issue-3882.rs index 8e617635b7c..78d094272ad 100644 --- a/tests/target/issue-3882.rs +++ b/tests/target/issue-3882.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn bar(_t: T, // bar ) { } diff --git a/tests/target/issue-3987/format_macro_bodies_false.rs b/tests/target/issue-3987/format_macro_bodies_false.rs index 1352b762e45..33c37ff0688 100644 --- a/tests/target/issue-3987/format_macro_bodies_false.rs +++ b/tests/target/issue-3987/format_macro_bodies_false.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: false +//@ rustfmt-format_macro_bodies: false // with comments macro_rules! macros { diff --git a/tests/target/issue-3987/format_macro_bodies_true.rs b/tests/target/issue-3987/format_macro_bodies_true.rs index 88d57159c85..dc67bb86e6b 100644 --- a/tests/target/issue-3987/format_macro_bodies_true.rs +++ b/tests/target/issue-3987/format_macro_bodies_true.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: true +//@ rustfmt-format_macro_bodies: true // with comments macro_rules! macros { diff --git a/tests/target/issue-4020.rs b/tests/target/issue-4020.rs index f29ecec028b..d6a43483af1 100644 --- a/tests/target/issue-4020.rs +++ b/tests/target/issue-4020.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /** foobar */ const foo1: u32 = 0; diff --git a/tests/target/issue-4036/one.rs b/tests/target/issue-4036/one.rs index 54e490b7fbe..0ab19292859 100644 --- a/tests/target/issue-4036/one.rs +++ b/tests/target/issue-4036/one.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true macro_rules! test { () => { diff --git a/tests/target/issue-4036/three.rs b/tests/target/issue-4036/three.rs index 394dc8633f5..8bfa5c89ba6 100644 --- a/tests/target/issue-4036/three.rs +++ b/tests/target/issue-4036/three.rs @@ -1,5 +1,5 @@ -// rustfmt-format_strings: true -// rustfmt-hard_tabs: true +//@ rustfmt-format_strings: true +//@ rustfmt-hard_tabs: true macro_rules! test { () => { diff --git a/tests/target/issue-4036/two.rs b/tests/target/issue-4036/two.rs index 01cafa76b68..ef1f48c3fa9 100644 --- a/tests/target/issue-4036/two.rs +++ b/tests/target/issue-4036/two.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true macro_rules! test { () => { diff --git a/tests/target/issue-4041.rs b/tests/target/issue-4041.rs index e9c693836f2..60008ed516d 100644 --- a/tests/target/issue-4041.rs +++ b/tests/target/issue-4041.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true //! List: //! - Sub list: //! + very long #1 blah blah blah blah blah blah blah blah blah blah blah blah diff --git a/tests/target/issue-4079.rs b/tests/target/issue-4079.rs index 1871c5b8a13..5a57841b6db 100644 --- a/tests/target/issue-4079.rs +++ b/tests/target/issue-4079.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /*! * Lorem ipsum dolor sit amet, consectetur adipiscing elit. In lacinia diff --git a/tests/target/issue-4152.rs b/tests/target/issue-4152.rs index 80f9ff5e304..e8438ae5e00 100644 --- a/tests/target/issue-4152.rs +++ b/tests/target/issue-4152.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true macro_rules! bit { ($bool:expr) => { diff --git a/tests/target/issue-4210-disabled.rs b/tests/target/issue-4210-disabled.rs index 3ba87aab8c5..dd788f2ba6e 100644 --- a/tests/target/issue-4210-disabled.rs +++ b/tests/target/issue-4210-disabled.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false /// Table that is > 80 symbols: /// diff --git a/tests/target/issue-4210.rs b/tests/target/issue-4210.rs index 3fd96639082..80b060df982 100644 --- a/tests/target/issue-4210.rs +++ b/tests/target/issue-4210.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Table that is > 80 symbols: /// diff --git a/tests/target/issue-4381/style_edition_2015.rs b/tests/target/issue-4381/style_edition_2015.rs index 1fc1613083e..d9a9d14dc0c 100644 --- a/tests/target/issue-4381/style_edition_2015.rs +++ b/tests/target/issue-4381/style_edition_2015.rs @@ -1,3 +1,3 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 use std::num::{NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8}; diff --git a/tests/target/issue-4381/style_edition_2024.rs b/tests/target/issue-4381/style_edition_2024.rs index df85636ad57..4056b85fc20 100644 --- a/tests/target/issue-4381/style_edition_2024.rs +++ b/tests/target/issue-4381/style_edition_2024.rs @@ -1,3 +1,3 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64}; diff --git a/tests/target/issue-447.rs b/tests/target/issue-447.rs index d41cdb65cd0..9b37acba9c2 100644 --- a/tests/target/issue-447.rs +++ b/tests/target/issue-447.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { if diff --git a/tests/target/issue-4530.rs b/tests/target/issue-4530.rs index 9e9fbf95c2d..31bfcd06336 100644 --- a/tests/target/issue-4530.rs +++ b/tests/target/issue-4530.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { let [ aaaaaaaaaaaaaaaaaaaaaaaaaa, diff --git a/tests/target/issue-4689/one.rs b/tests/target/issue-4689/one.rs index fb523f38501..22a02d2f241 100644 --- a/tests/target/issue-4689/one.rs +++ b/tests/target/issue-4689/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/target/issue-4689/two.rs b/tests/target/issue-4689/two.rs index 30303490129..ae5b943f015 100644 --- a/tests/target/issue-4689/two.rs +++ b/tests/target/issue-4689/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // Based on the issue description pub trait PrettyPrinter<'tcx>: diff --git a/tests/target/issue-4791/buggy.rs b/tests/target/issue-4791/buggy.rs index fff58be99a5..a1f2ed854d0 100644 --- a/tests/target/issue-4791/buggy.rs +++ b/tests/target/issue-4791/buggy.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 30 -// rustfmt-trailing_comma: Never +//@ rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-trailing_comma: Never struct Foo { group_a: u8, diff --git a/tests/target/issue-4791/issue_4928.rs b/tests/target/issue-4791/issue_4928.rs index 29f6bda9063..e54c6fd9f5f 100644 --- a/tests/target/issue-4791/issue_4928.rs +++ b/tests/target/issue-4791/issue_4928.rs @@ -1,22 +1,22 @@ -// rustfmt-brace_style: SameLineWhere -// rustfmt-comment_width: 100 -// rustfmt-edition: 2018 -// rustfmt-fn_params_layout: Compressed -// rustfmt-hard_tabs: false -// rustfmt-match_block_trailing_comma: true -// rustfmt-max_width: 100 -// rustfmt-merge_derives: false -// rustfmt-newline_style: Unix -// rustfmt-normalize_doc_attributes: true -// rustfmt-overflow_delimited_expr: true -// rustfmt-reorder_imports: false -// rustfmt-reorder_modules: true -// rustfmt-struct_field_align_threshold: 20 -// rustfmt-tab_spaces: 4 -// rustfmt-trailing_comma: Never -// rustfmt-use_small_heuristics: Max -// rustfmt-use_try_shorthand: true -// rustfmt-wrap_comments: true +//@ rustfmt-brace_style: SameLineWhere +//@ rustfmt-comment_width: 100 +//@ rustfmt-edition: 2018 +//@ rustfmt-fn_params_layout: Compressed +//@ rustfmt-hard_tabs: false +//@ rustfmt-match_block_trailing_comma: true +//@ rustfmt-max_width: 100 +//@ rustfmt-merge_derives: false +//@ rustfmt-newline_style: Unix +//@ rustfmt-normalize_doc_attributes: true +//@ rustfmt-overflow_delimited_expr: true +//@ rustfmt-reorder_imports: false +//@ rustfmt-reorder_modules: true +//@ rustfmt-struct_field_align_threshold: 20 +//@ rustfmt-tab_spaces: 4 +//@ rustfmt-trailing_comma: Never +//@ rustfmt-use_small_heuristics: Max +//@ rustfmt-use_try_shorthand: true +//@ rustfmt-wrap_comments: true /// Lorem ipsum dolor sit amet. #[repr(C)] diff --git a/tests/target/issue-4791/no_trailing_comma.rs b/tests/target/issue-4791/no_trailing_comma.rs index 4a37163969a..c5817b05530 100644 --- a/tests/target/issue-4791/no_trailing_comma.rs +++ b/tests/target/issue-4791/no_trailing_comma.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 0 -// rustfmt-trailing_comma: Never +//@ rustfmt-struct_field_align_threshold: 0 +//@ rustfmt-trailing_comma: Never pub struct Baz { group_a: u8, diff --git a/tests/target/issue-4791/trailing_comma.rs b/tests/target/issue-4791/trailing_comma.rs index 29a224b3f6d..2b288e92832 100644 --- a/tests/target/issue-4791/trailing_comma.rs +++ b/tests/target/issue-4791/trailing_comma.rs @@ -1,5 +1,5 @@ -// rustfmt-struct_field_align_threshold: 30 -// rustfmt-trailing_comma: Always +//@ rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-trailing_comma: Always struct Foo { group_a: u8, diff --git a/tests/target/issue-4926/deeply_nested_struct.rs b/tests/target/issue-4926/deeply_nested_struct.rs index 072cf2f6674..66c6ea15a4c 100644 --- a/tests/target/issue-4926/deeply_nested_struct.rs +++ b/tests/target/issue-4926/deeply_nested_struct.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/target/issue-4926/deeply_nested_struct_with_long_field_names.rs b/tests/target/issue-4926/deeply_nested_struct_with_long_field_names.rs index c7bc7f7296d..3937817744e 100644 --- a/tests/target/issue-4926/deeply_nested_struct_with_long_field_names.rs +++ b/tests/target/issue-4926/deeply_nested_struct_with_long_field_names.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { really_really_long_field_a: i32, diff --git a/tests/target/issue-4926/deeply_nested_struct_with_many_fields.rs b/tests/target/issue-4926/deeply_nested_struct_with_many_fields.rs index 69793162519..24377dc4d03 100644 --- a/tests/target/issue-4926/deeply_nested_struct_with_many_fields.rs +++ b/tests/target/issue-4926/deeply_nested_struct_with_many_fields.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/target/issue-4926/enum_struct_field.rs b/tests/target/issue-4926/enum_struct_field.rs index 2471df84653..75741908725 100644 --- a/tests/target/issue-4926/enum_struct_field.rs +++ b/tests/target/issue-4926/enum_struct_field.rs @@ -1,6 +1,6 @@ -// rustfmt-struct_field_align_threshold: 30 -// rustfmt-enum_discrim_align_threshold: 30 -// rustfmt-imports_layout: HorizontalVertical +//@ rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-enum_discrim_align_threshold: 30 +//@ rustfmt-imports_layout: HorizontalVertical #[derive(Default)] struct InnerStructA { diff --git a/tests/target/issue-4926/minimum_example.rs b/tests/target/issue-4926/minimum_example.rs index 06e18427465..6a506064a1a 100644 --- a/tests/target/issue-4926/minimum_example.rs +++ b/tests/target/issue-4926/minimum_example.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/target/issue-4926/struct_with_long_field_names.rs b/tests/target/issue-4926/struct_with_long_field_names.rs index ac4674ab5d5..889412f58d7 100644 --- a/tests/target/issue-4926/struct_with_long_field_names.rs +++ b/tests/target/issue-4926/struct_with_long_field_names.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { really_really_long_field_a: i32, diff --git a/tests/target/issue-4926/struct_with_many_fields.rs b/tests/target/issue-4926/struct_with_many_fields.rs index 96dfe14bf7d..0f4961dff62 100644 --- a/tests/target/issue-4926/struct_with_many_fields.rs +++ b/tests/target/issue-4926/struct_with_many_fields.rs @@ -1,4 +1,4 @@ -// rustfmt-struct_field_align_threshold: 30 +//@ rustfmt-struct_field_align_threshold: 30 struct X { a: i32, diff --git a/tests/target/issue-5012/trailing_comma_always.rs b/tests/target/issue-5012/trailing_comma_always.rs index ff9c40fbbd8..20e53f14fea 100644 --- a/tests/target/issue-5012/trailing_comma_always.rs +++ b/tests/target/issue-5012/trailing_comma_always.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Always +//@ rustfmt-trailing_comma: Always pub struct Matrix where diff --git a/tests/target/issue-5012/trailing_comma_never.rs b/tests/target/issue-5012/trailing_comma_never.rs index 2fac8eae52b..3e80e8f396f 100644 --- a/tests/target/issue-5012/trailing_comma_never.rs +++ b/tests/target/issue-5012/trailing_comma_never.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Never +//@ rustfmt-trailing_comma: Never pub struct Matrix where diff --git a/tests/target/issue-5023.rs b/tests/target/issue-5023.rs index aca47d0f4a9..713c42fc3bc 100644 --- a/tests/target/issue-5023.rs +++ b/tests/target/issue-5023.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // below we try and force a split at a byte in the middle of a multi-byte // character. The two parts of the first line are constructed such that: diff --git a/tests/target/issue-5030.rs b/tests/target/issue-5030.rs index 8ac3888bdbe..1710faff3be 100644 --- a/tests/target/issue-5030.rs +++ b/tests/target/issue-5030.rs @@ -1,5 +1,5 @@ -// rustfmt-imports_granularity: Item -// rustfmt-group_imports: One +//@ rustfmt-imports_granularity: Item +//@ rustfmt-group_imports: One // Confirm that attributes are duplicated to all items in the use statement #[cfg(feature = "foo")] diff --git a/tests/target/issue-5066/multi_line_struct_trailing_comma_always_struct_lit_width_0.rs b/tests/target/issue-5066/multi_line_struct_trailing_comma_always_struct_lit_width_0.rs index c7122c67623..8613887cd9b 100644 --- a/tests/target/issue-5066/multi_line_struct_trailing_comma_always_struct_lit_width_0.rs +++ b/tests/target/issue-5066/multi_line_struct_trailing_comma_always_struct_lit_width_0.rs @@ -1,6 +1,6 @@ -// rustfmt-trailing_comma: Always -// rustfmt-struct_lit_single_line: false -// rustfmt-struct_lit_width: 0 +//@ rustfmt-trailing_comma: Always +//@ rustfmt-struct_lit_single_line: false +//@ rustfmt-struct_lit_width: 0 fn main() { let Foo { diff --git a/tests/target/issue-5066/multi_line_struct_trailing_comma_never_struct_lit_width_0.rs b/tests/target/issue-5066/multi_line_struct_trailing_comma_never_struct_lit_width_0.rs index 68e89c4179f..a340cb15ddc 100644 --- a/tests/target/issue-5066/multi_line_struct_trailing_comma_never_struct_lit_width_0.rs +++ b/tests/target/issue-5066/multi_line_struct_trailing_comma_never_struct_lit_width_0.rs @@ -1,6 +1,6 @@ -// rustfmt-trailing_comma: Never -// rustfmt-struct_lit_single_line: false -// rustfmt-struct_lit_width: 0 +//@ rustfmt-trailing_comma: Never +//@ rustfmt-struct_lit_single_line: false +//@ rustfmt-struct_lit_width: 0 fn main() { let Foo { diff --git a/tests/target/issue-5066/multi_line_struct_with_trailing_comma_always.rs b/tests/target/issue-5066/multi_line_struct_with_trailing_comma_always.rs index 3368f070386..e9962ad2b62 100644 --- a/tests/target/issue-5066/multi_line_struct_with_trailing_comma_always.rs +++ b/tests/target/issue-5066/multi_line_struct_with_trailing_comma_always.rs @@ -1,5 +1,5 @@ -// rustfmt-trailing_comma: Always -// rustfmt-struct_lit_single_line: false +//@ rustfmt-trailing_comma: Always +//@ rustfmt-struct_lit_single_line: false // There is an issue with how this is formatted. // formatting should look like ./multi_line_struct_trailing_comma_always_struct_lit_width_0.rs diff --git a/tests/target/issue-5066/multi_line_struct_with_trailing_comma_never.rs b/tests/target/issue-5066/multi_line_struct_with_trailing_comma_never.rs index cf63c4c983c..4558b8c4179 100644 --- a/tests/target/issue-5066/multi_line_struct_with_trailing_comma_never.rs +++ b/tests/target/issue-5066/multi_line_struct_with_trailing_comma_never.rs @@ -1,5 +1,5 @@ -// rustfmt-trailing_comma: Never -// rustfmt-struct_lit_single_line: false +//@ rustfmt-trailing_comma: Never +//@ rustfmt-struct_lit_single_line: false // There is an issue with how this is formatted. // formatting should look like ./multi_line_struct_trailing_comma_never_struct_lit_width_0.rs diff --git a/tests/target/issue-5066/with_trailing_comma_always.rs b/tests/target/issue-5066/with_trailing_comma_always.rs index e20bcec9316..2eb08e02dba 100644 --- a/tests/target/issue-5066/with_trailing_comma_always.rs +++ b/tests/target/issue-5066/with_trailing_comma_always.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Always +//@ rustfmt-trailing_comma: Always fn main() { let Foo { a, .. } = b; diff --git a/tests/target/issue-5066/with_trailing_comma_never.rs b/tests/target/issue-5066/with_trailing_comma_never.rs index 8b95bb137bc..a9c3f7bb5f6 100644 --- a/tests/target/issue-5066/with_trailing_comma_never.rs +++ b/tests/target/issue-5066/with_trailing_comma_never.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Never +//@ rustfmt-trailing_comma: Never fn main() { let Foo { a, .. } = b; diff --git a/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_false.rs b/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_false.rs index f4801de0184..dbe4336ad4b 100644 --- a/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_false.rs +++ b/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false fn main() { { diff --git a/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs b/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs index b289c9f859e..291da5c9ea3 100644 --- a/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs +++ b/tests/target/issue-5088/deeply_nested_long_comment_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true fn main() { { diff --git a/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_false.rs b/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_false.rs index 60beed1b048..c82c39c2d60 100644 --- a/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_false.rs +++ b/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false // - some itemized block 1 // - some itemized block 2 diff --git a/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_true.rs b/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_true.rs index 84fba4b7c19..e62afd13a24 100644 --- a/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_true.rs +++ b/tests/target/issue-5088/multi_line_itemized_block_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // - some itemized block 1 // - some itemized block 2 diff --git a/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_false.rs b/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_false.rs index d1bf44f6c74..c8a908c405e 100644 --- a/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_false.rs +++ b/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false // Some text // - some itemized block 1 diff --git a/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_true.rs b/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_true.rs index f767491f902..43f46893c79 100644 --- a/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_true.rs +++ b/tests/target/issue-5088/multi_line_text_with_itemized_block_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Some text // - some itemized block 1 diff --git a/tests/target/issue-5088/single_line_itemized_block_wrap_comments_false.rs b/tests/target/issue-5088/single_line_itemized_block_wrap_comments_false.rs index 2cd85c787f9..c6da773d345 100644 --- a/tests/target/issue-5088/single_line_itemized_block_wrap_comments_false.rs +++ b/tests/target/issue-5088/single_line_itemized_block_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false // - some itemized block 1 diff --git a/tests/target/issue-5088/single_line_itemized_block_wrap_comments_true.rs b/tests/target/issue-5088/single_line_itemized_block_wrap_comments_true.rs index e9f343d75d5..4e2995e1b91 100644 --- a/tests/target/issue-5088/single_line_itemized_block_wrap_comments_true.rs +++ b/tests/target/issue-5088/single_line_itemized_block_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // - some itemized block 1 diff --git a/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_false.rs b/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_false.rs index 97bb7733d18..6fc39fb04ac 100644 --- a/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_false.rs +++ b/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false // // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. diff --git a/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs b/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs index c8af8383e05..3eadaaa28df 100644 --- a/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs +++ b/tests/target/issue-5088/start_with_empty_comment_very_long_itemized_block_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod diff --git a/tests/target/issue-5088/start_with_empty_comment_wrap_comments_false.rs b/tests/target/issue-5088/start_with_empty_comment_wrap_comments_false.rs index 75cc42c0e66..9718302c774 100644 --- a/tests/target/issue-5088/start_with_empty_comment_wrap_comments_false.rs +++ b/tests/target/issue-5088/start_with_empty_comment_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false // // - some itemized block 1 diff --git a/tests/target/issue-5088/start_with_empty_comment_wrap_comments_true.rs b/tests/target/issue-5088/start_with_empty_comment_wrap_comments_true.rs index ef2c8f90cd3..c032f40e30e 100644 --- a/tests/target/issue-5088/start_with_empty_comment_wrap_comments_true.rs +++ b/tests/target/issue-5088/start_with_empty_comment_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // // - some itemized block 1 diff --git a/tests/target/issue-5088/very_long_comment_wrap_comments_false.rs b/tests/target/issue-5088/very_long_comment_wrap_comments_false.rs index c826cc5d4da..00075bb8c7d 100644 --- a/tests/target/issue-5088/very_long_comment_wrap_comments_false.rs +++ b/tests/target/issue-5088/very_long_comment_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. diff --git a/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs b/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs index 7f764dbd8a2..e55adb8b2ce 100644 --- a/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs +++ b/tests/target/issue-5088/very_long_comment_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod // tempor incididunt ut labore et dolore magna aliqua. diff --git a/tests/target/issue-5095.rs b/tests/target/issue-5095.rs index 6981a65808c..5c99eee4952 100644 --- a/tests/target/issue-5095.rs +++ b/tests/target/issue-5095.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true pub mod a_long_name { pub mod b_long_name { diff --git a/tests/target/issue-5136-1.rs b/tests/target/issue-5136-1.rs index 75231555232..99b781cc89f 100644 --- a/tests/target/issue-5136-1.rs +++ b/tests/target/issue-5136-1.rs @@ -4,4 +4,4 @@ // in the --file-lines range. // This should prevent rustfmt from many any formatting changes at all: -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] diff --git a/tests/target/issue-5136-2.rs b/tests/target/issue-5136-2.rs index fe3cfcf37b8..428aac02ad4 100644 --- a/tests/target/issue-5136-2.rs +++ b/tests/target/issue-5136-2.rs @@ -2,4 +2,4 @@ // Test that whitespace at beginning of file is preserved when not in // --file-lines range. // This should prevent rustfmt from making any formatting changes at all: -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] diff --git a/tests/target/issue-5136-3.rs b/tests/target/issue-5136-3.rs index c152181bc2f..83ad8b91e8b 100644 --- a/tests/target/issue-5136-3.rs +++ b/tests/target/issue-5136-3.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // Test that a missing newline at the end of the file is preserved when the last // line is not in the --file-lines range. // Important: When editing this file, make sure not to add a newline at the end diff --git a/tests/target/issue-5136-4.rs b/tests/target/issue-5136-4.rs index 005167dff63..1350393ad2b 100644 --- a/tests/target/issue-5136-4.rs +++ b/tests/target/issue-5136-4.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // Test that a missing space at the end of a doc comment is preserved when the // line is not in the --file-lines range. //! diff --git a/tests/target/issue-5136-5.rs b/tests/target/issue-5136-5.rs index 0f836aa989f..ba3beccb75f 100644 --- a/tests/target/issue-5136-5.rs +++ b/tests/target/issue-5136-5.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [] +//@ rustfmt-file_lines: [] // Test that the space before the comment is not removed if the line is not // contained in `--file-lines`. // Note: It's important for the bug to repro that there is no newline at the diff --git a/tests/target/issue-5157/indented_itemized_markdown_blockquote.rs b/tests/target/issue-5157/indented_itemized_markdown_blockquote.rs index e47677f2039..0a3a6d92515 100644 --- a/tests/target/issue-5157/indented_itemized_markdown_blockquote.rs +++ b/tests/target/issue-5157/indented_itemized_markdown_blockquote.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a /// > sample_state relative to each DataReader. The sample_state can diff --git a/tests/target/issue-5157/nested_itemized_markdown_blockquote.rs b/tests/target/issue-5157/nested_itemized_markdown_blockquote.rs index 079510442b7..c333ed86754 100644 --- a/tests/target/issue-5157/nested_itemized_markdown_blockquote.rs +++ b/tests/target/issue-5157/nested_itemized_markdown_blockquote.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a /// > sample_state relative to each DataReader. The sample_state can either be diff --git a/tests/target/issue-5157/support_itemized_markdown_blockquote.rs b/tests/target/issue-5157/support_itemized_markdown_blockquote.rs index 029ee37d22a..8e3f8b98aad 100644 --- a/tests/target/issue-5157/support_itemized_markdown_blockquote.rs +++ b/tests/target/issue-5157/support_itemized_markdown_blockquote.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// > For each sample received, the middleware internally maintains a /// > sample_state relative to each DataReader. The sample_state can either be diff --git a/tests/target/issue-5234.rs b/tests/target/issue-5234.rs index 7ee9e46d1ef..1584c025467 100644 --- a/tests/target/issue-5234.rs +++ b/tests/target/issue-5234.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// ``` /// ``` diff --git a/tests/target/issue-5238/markdown_header_wrap_comments_false.rs b/tests/target/issue-5238/markdown_header_wrap_comments_false.rs index 229c6e5753d..3b2981cf1dd 100644 --- a/tests/target/issue-5238/markdown_header_wrap_comments_false.rs +++ b/tests/target/issue-5238/markdown_header_wrap_comments_false.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false /// no markdown header so rustfmt should wrap this comment when `format_code_in_doc_comments = true` and `wrap_comments = true` fn not_documented_with_markdown_header() { diff --git a/tests/target/issue-5238/markdown_header_wrap_comments_true.rs b/tests/target/issue-5238/markdown_header_wrap_comments_true.rs index 87dae58eccd..60dc04df900 100644 --- a/tests/target/issue-5238/markdown_header_wrap_comments_true.rs +++ b/tests/target/issue-5238/markdown_header_wrap_comments_true.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// no markdown header so rustfmt should wrap this comment when /// `format_code_in_doc_comments = true` and `wrap_comments = true` diff --git a/tests/target/issue-5244/unwrapped.rs b/tests/target/issue-5244/unwrapped.rs index 79530cab82d..fca6533327a 100644 --- a/tests/target/issue-5244/unwrapped.rs +++ b/tests/target/issue-5244/unwrapped.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: false +//@ rustfmt-wrap_comments: false /// Here is me writing some documentation that is too long oh me oh my now some code please! /// ``` diff --git a/tests/target/issue-5244/wrapped.rs b/tests/target/issue-5244/wrapped.rs index f967b3c1c8c..ddc325cbb05 100644 --- a/tests/target/issue-5244/wrapped.rs +++ b/tests/target/issue-5244/wrapped.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Here is me writing some documentation that is too long oh me oh my now some /// code please! diff --git a/tests/target/issue-5260.rs b/tests/target/issue-5260.rs index 171f6fa51b7..b066eb37ceb 100644 --- a/tests/target/issue-5260.rs +++ b/tests/target/issue-5260.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// [MyType](VeryLongPathToMyType::NoLineBreak::Here::Okay::ThatWouldBeNice::Thanks) fn documented_with_longtype() { diff --git a/tests/target/issue-5270/merge_derives_false.rs b/tests/target/issue-5270/merge_derives_false.rs index 3b6f7e66993..2b5adfd4d02 100644 --- a/tests/target/issue-5270/merge_derives_false.rs +++ b/tests/target/issue-5270/merge_derives_false.rs @@ -1,4 +1,4 @@ -// rustfmt-merge_derives:false +//@ rustfmt-merge_derives:false #[rustfmt::skip::attributes(derive)] #[allow(dead_code)] diff --git a/tests/target/issue-5270/merge_derives_true.rs b/tests/target/issue-5270/merge_derives_true.rs index 5f488b4542d..17f8dd35a31 100644 --- a/tests/target/issue-5270/merge_derives_true.rs +++ b/tests/target/issue-5270/merge_derives_true.rs @@ -1,4 +1,4 @@ -// rustfmt-merge_derives:true +//@ rustfmt-merge_derives:true #[rustfmt::skip::attributes(derive)] #[allow(dead_code)] diff --git a/tests/target/issue-539.rs b/tests/target/issue-539.rs index adeb33555fb..d5cc803aaa1 100644 --- a/tests/target/issue-539.rs +++ b/tests/target/issue-539.rs @@ -1,3 +1,3 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // FIXME (#3300): Should allow items to be anonymous. Right now // we just use dummy names for anon items. diff --git a/tests/target/issue-5488.rs b/tests/target/issue-5488.rs index 0cb37c56f39..e7c9ab57cc7 100644 --- a/tests/target/issue-5488.rs +++ b/tests/target/issue-5488.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: true +//@ rustfmt-use_field_init_shorthand: true struct MyStruct(u32); struct AnotherStruct { diff --git a/tests/target/issue-5568.rs b/tests/target/issue-5568.rs index 03ca3a4523c..849d20661cd 100644 --- a/tests/target/issue-5568.rs +++ b/tests/target/issue-5568.rs @@ -1,5 +1,5 @@ -// rustfmt-max_width: 119 -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-max_width: 119 +//@ rustfmt-format_code_in_doc_comments: true mod libs { fn mrbgems_sources() { diff --git a/tests/target/issue-5586.rs b/tests/target/issue-5586.rs index afe13d1fb1c..d6189ae9535 100644 --- a/tests/target/issue-5586.rs +++ b/tests/target/issue-5586.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { // sample 1 { diff --git a/tests/target/issue-5655/one.rs b/tests/target/issue-5655/one.rs index 62df2655c29..8d3d1c4c7b3 100644 --- a/tests/target/issue-5655/one.rs +++ b/tests/target/issue-5655/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn foo(_: T) where diff --git a/tests/target/issue-5655/two.rs b/tests/target/issue-5655/two.rs index 4a7eb4f4bc2..63cdbc55646 100644 --- a/tests/target/issue-5655/two.rs +++ b/tests/target/issue-5655/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn foo(_: T) where diff --git a/tests/target/issue-5797/retain_trailing_semicolon.rs b/tests/target/issue-5797/retain_trailing_semicolon.rs index 851073971f6..2f5f8ce2848 100644 --- a/tests/target/issue-5797/retain_trailing_semicolon.rs +++ b/tests/target/issue-5797/retain_trailing_semicolon.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_semicolon: false +//@ rustfmt-trailing_semicolon: false fn foo() {} fn main() { diff --git a/tests/target/issue-5801/attribute_does_not_wrap_within_max_width.rs b/tests/target/issue-5801/attribute_does_not_wrap_within_max_width.rs index e3b6f3b37f5..46ee302cb11 100644 --- a/tests/target/issue-5801/attribute_does_not_wrap_within_max_width.rs +++ b/tests/target/issue-5801/attribute_does_not_wrap_within_max_width.rs @@ -1,4 +1,4 @@ -// rustfmt-config: issue-5801-v2.toml +//@ rustfmt-config: issue-5801-v2.toml pub enum Severity { #[something(AAAAAAAAAAAAA, BBBBBBBBBBBBBB, CCCCCCCCCCCCCCCC, DDDDDDDDDDDDD, EEEEEEEEEEEE, FFFFFFFFFFF, GGGGGGGGGGG)] diff --git a/tests/target/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs b/tests/target/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs index 89676666225..14951da737b 100644 --- a/tests/target/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs +++ b/tests/target/issue-5801/attribute_unexpectedly_wraps_before_max_width.rs @@ -1,4 +1,4 @@ -// rustfmt-config: issue-5801-v1.toml +//@ rustfmt-config: issue-5801-v1.toml pub enum Severity { #[something( diff --git a/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs b/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs index 461b5873a68..403697f2d04 100644 --- a/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs +++ b/tests/target/issue-5801/comment_does_not_wrap_within_max_width.rs @@ -1,7 +1,7 @@ -// rustfmt-comment_width: 120 -// rustfmt-wrap_comments: true -// rustfmt-max_width: 120 -// rustfmt-style_edition: 2024 +//@ rustfmt-comment_width: 120 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 120 +//@ rustfmt-style_edition: 2024 /// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String { diff --git a/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs b/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs index 58bb8a1c2e3..de38c743e35 100644 --- a/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs +++ b/tests/target/issue-5801/comment_unexpectedly_wraps_before_max_width.rs @@ -1,7 +1,7 @@ -// rustfmt-comment_width: 120 -// rustfmt-wrap_comments: true -// rustfmt-max_width: 120 -// rustfmt-style_edition: 2015 +//@ rustfmt-comment_width: 120 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 120 +//@ rustfmt-style_edition: 2015 /// This function is 120 columns wide and is left alone. This comment is 120 columns wide and the formatter is also fine fn my_super_cool_function_name(my_very_cool_argument_name: String, my_other_very_cool_argument_name: String) -> String { diff --git a/tests/target/issue-5835.rs b/tests/target/issue-5835.rs index 3e4da3492ce..52527f4236c 100644 --- a/tests/target/issue-5835.rs +++ b/tests/target/issue-5835.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// . a pub fn foo() {} diff --git a/tests/target/issue-5852/horizontal.rs b/tests/target/issue-5852/horizontal.rs index 017d83c9f9a..b110f909300 100644 --- a/tests/target/issue-5852/horizontal.rs +++ b/tests/target/issue-5852/horizontal.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_layout: Horizontal +//@ rustfmt-imports_layout: Horizontal use std::{ fs, diff --git a/tests/target/issue-5852/horizontal_vertical.rs b/tests/target/issue-5852/horizontal_vertical.rs index 35e2d0a2624..eecd22e6c29 100644 --- a/tests/target/issue-5852/horizontal_vertical.rs +++ b/tests/target/issue-5852/horizontal_vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_layout: HorizontalVertical +//@ rustfmt-imports_layout: HorizontalVertical use std::{ fs, diff --git a/tests/target/issue-5852/split.rs b/tests/target/issue-5852/split.rs index e00086dd47b..a83bb8e50f4 100644 --- a/tests/target/issue-5852/split.rs +++ b/tests/target/issue-5852/split.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_granularity: Item +//@ rustfmt-imports_granularity: Item use std::{ fs, diff --git a/tests/target/issue-5852/vertical.rs b/tests/target/issue-5852/vertical.rs index f53a68c944a..73adbc4bb02 100644 --- a/tests/target/issue-5852/vertical.rs +++ b/tests/target/issue-5852/vertical.rs @@ -1,4 +1,4 @@ -// rustfmt-imports_layout: Vertical +//@ rustfmt-imports_layout: Vertical use std::{ fs, diff --git a/tests/target/issue-5987/one.rs b/tests/target/issue-5987/one.rs index 17327feead5..abe22d6b87f 100644 --- a/tests/target/issue-5987/one.rs +++ b/tests/target/issue-5987/one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn main() { trace!( diff --git a/tests/target/issue-5987/two.rs b/tests/target/issue-5987/two.rs index 41ecb13e3db..46663e7373f 100644 --- a/tests/target/issue-5987/two.rs +++ b/tests/target/issue-5987/two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { trace!( diff --git a/tests/target/issue-6147/case_rustfmt_v1.rs b/tests/target/issue-6147/case_rustfmt_v1.rs index d8e67655e4c..1164197e7fd 100644 --- a/tests/target/issue-6147/case_rustfmt_v1.rs +++ b/tests/target/issue-6147/case_rustfmt_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 pub fn main() { let a = Some(12); diff --git a/tests/target/issue-6147/case_rustfmt_v2.rs b/tests/target/issue-6147/case_rustfmt_v2.rs index 9d0b12d686b..a2cba547e9e 100644 --- a/tests/target/issue-6147/case_rustfmt_v2.rs +++ b/tests/target/issue-6147/case_rustfmt_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub fn main() { let a = Some(12); diff --git a/tests/target/issue-6202/long_pat.rs b/tests/target/issue-6202/long_pat.rs index 1d2282626a2..356452d2965 100644 --- a/tests/target/issue-6202/long_pat.rs +++ b/tests/target/issue-6202/long_pat.rs @@ -1,7 +1,7 @@ -// rustfmt-max_width: 120 -// rustfmt-error_on_line_overflow: true -// rustfmt-style_edition: 2027 -// rustfmt-edition: 2024 +//@ rustfmt-max_width: 120 +//@ rustfmt-error_on_line_overflow: true +//@ rustfmt-style_edition: 2027 +//@ rustfmt-edition: 2024 impl EarlyLintPass for NeedlessContinue { fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { diff --git a/tests/target/issue-6243.rs b/tests/target/issue-6243.rs index e538794c9ba..8df99f09d36 100644 --- a/tests/target/issue-6243.rs +++ b/tests/target/issue-6243.rs @@ -1,3 +1,3 @@ -// rustfmt-imports_granularity: Module +//@ rustfmt-imports_granularity: Module use risingwave_batch::executor::{BoxedExecutor, JoinType}; diff --git a/tests/target/issue-6333-2024.rs b/tests/target/issue-6333-2024.rs index c64d4dff8a8..c79abce1dc6 100644 --- a/tests/target/issue-6333-2024.rs +++ b/tests/target/issue-6333-2024.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-max_width: 125 +//@ rustfmt-edition: 2024 +//@ rustfmt-max_width: 125 pub use crate::r#_StructuredEncryptionUtil_Compile::CanonCryptoItem; pub use crate::r#_StructuredEncryptionUtil_Compile::MessageID; pub use crate::r#_Wrappers_Compile::Outcome; diff --git a/tests/target/issue-6333.rs b/tests/target/issue-6333.rs index b2f167452c3..0a647759c82 100644 --- a/tests/target/issue-6333.rs +++ b/tests/target/issue-6333.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2021 -// rustfmt-max_width: 125 +//@ rustfmt-edition: 2021 +//@ rustfmt-max_width: 125 pub use crate::r#_StructuredEncryptionUtil_Compile::CanonCryptoItem; pub use crate::r#_StructuredEncryptionUtil_Compile::MessageID; pub use crate::r#_Wrappers_Compile::Outcome; diff --git a/tests/target/issue-6411.rs b/tests/target/issue-6411.rs index a1166a749f2..044e9ad0737 100644 --- a/tests/target/issue-6411.rs +++ b/tests/target/issue-6411.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2021 +//@ rustfmt-edition: 2021 fn test_break() { 'r#if: { diff --git a/tests/target/issue-6561/trait-fn.rs b/tests/target/issue-6561/trait-fn.rs index a30396be561..c9ddfbfea97 100644 --- a/tests/target/issue-6561/trait-fn.rs +++ b/tests/target/issue-6561/trait-fn.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2015 +//@ rustfmt-edition: 2015 trait A { fn f1(#[allow()] u32); diff --git a/tests/target/issue-6651/custom_width.rs b/tests/target/issue-6651/custom_width.rs index b46bd5ef5cc..dfe74787101 100644 --- a/tests/target/issue-6651/custom_width.rs +++ b/tests/target/issue-6651/custom_width.rs @@ -1,6 +1,6 @@ -// rustfmt-format_macro_bodies: true -// rustfmt-max_width: 82 -// rustfmt-fn_call_width: 76 +//@ rustfmt-format_macro_bodies: true +//@ rustfmt-max_width: 82 +//@ rustfmt-fn_call_width: 76 macro_rules! short { () => { diff --git a/tests/target/issue-6651/default.rs b/tests/target/issue-6651/default.rs index 6fab41d9018..3f3d34b5641 100644 --- a/tests/target/issue-6651/default.rs +++ b/tests/target/issue-6651/default.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_bodies: true +//@ rustfmt-format_macro_bodies: true macro_rules! short { () => { diff --git a/tests/target/issue-6795.rs b/tests/target/issue-6795.rs index 7de2d1140fb..7b87b04fcd0 100644 --- a/tests/target/issue-6795.rs +++ b/tests/target/issue-6795.rs @@ -1,4 +1,4 @@ -// rustfmt-use_field_init_shorthand: true +//@ rustfmt-use_field_init_shorthand: true foo!(Foo { a: a }); diff --git a/tests/target/issue-6825.rs b/tests/target/issue-6825.rs index 6c9ac60dddb..3205db0eb33 100644 --- a/tests/target/issue-6825.rs +++ b/tests/target/issue-6825.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2024 +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2024 pub async fn foo(// OriginalUri(original_uri): OriginalUri, ) -> Option>>> { None diff --git a/tests/target/issue-683.rs b/tests/target/issue-683.rs index adeb33555fb..d5cc803aaa1 100644 --- a/tests/target/issue-683.rs +++ b/tests/target/issue-683.rs @@ -1,3 +1,3 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // FIXME (#3300): Should allow items to be anonymous. Right now // we just use dummy names for anon items. diff --git a/tests/target/issue-6863/empty-stmt.rs b/tests/target/issue-6863/empty-stmt.rs index b67340f5bc0..fdf84fd3ce2 100644 --- a/tests/target/issue-6863/empty-stmt.rs +++ b/tests/target/issue-6863/empty-stmt.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-6863/empty-stmt.rs","range":[5,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-6863/empty-stmt.rs","range":[5,5]}] fn main() { ; diff --git a/tests/target/issue-6863/fn-stmts.rs b/tests/target/issue-6863/fn-stmts.rs index 82ed6dc37c8..b28ad89aa1d 100644 --- a/tests/target/issue-6863/fn-stmts.rs +++ b/tests/target/issue-6863/fn-stmts.rs @@ -1,4 +1,4 @@ -// rustfmt-file_lines: [{"file":"tests/source/issue-6863/fn-stmts.rs","range":[5,5]}] +//@ rustfmt-file_lines: [{"file":"tests/source/issue-6863/fn-stmts.rs","range":[5,5]}] fn main() { println!("a"); diff --git a/tests/target/issue-691.rs b/tests/target/issue-691.rs index 7473d070eff..2dd86d1dfd3 100644 --- a/tests/target/issue-691.rs +++ b/tests/target/issue-691.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true //! `std` or `core` and simply link to this library. In case the target //! platform has no hardware diff --git a/tests/target/issue-7054.rs b/tests/target/issue-7054.rs index 754c0379c76..b5e8f0c25b2 100644 --- a/tests/target/issue-7054.rs +++ b/tests/target/issue-7054.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 // `for await` is spelled with two tokens, so the source may separate them with // arbitrary whitespace or comments. rustfmt must not search for the rendered diff --git a/tests/target/issue-977.rs b/tests/target/issue-977.rs index 3784a387450..aa4449f898a 100644 --- a/tests/target/issue-977.rs +++ b/tests/target/issue-977.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true trait NameC { // comment diff --git a/tests/target/issue_1306.rs b/tests/target/issue_1306.rs index 6bb514cdfe5..d6b976880ae 100644 --- a/tests/target/issue_1306.rs +++ b/tests/target/issue_1306.rs @@ -1,8 +1,8 @@ -// rustfmt-max_width: 160 -// rustfmt-fn_call_width: 96 -// rustfmt-fn_args_layout: Compressed -// rustfmt-trailing_comma: Always -// rustfmt-wrap_comments: true +//@ rustfmt-max_width: 160 +//@ rustfmt-fn_call_width: 96 +//@ rustfmt-fn_args_layout: Compressed +//@ rustfmt-trailing_comma: Always +//@ rustfmt-wrap_comments: true fn foo() { for elem in try!(gen_epub_book::ops::parse_descriptor_file( diff --git a/tests/target/issue_3937.rs b/tests/target/issue_3937.rs index 80673108500..b91f4054971 100644 --- a/tests/target/issue_3937.rs +++ b/tests/target/issue_3937.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments:true +//@ rustfmt-format_code_in_doc_comments:true struct Foo { // a: i32, diff --git a/tests/target/issue_4049.rs b/tests/target/issue_4049.rs index fe025a0f649..11e04e4fbce 100644 --- a/tests/target/issue_4049.rs +++ b/tests/target/issue_4049.rs @@ -1,8 +1,8 @@ -// rustfmt-max_width: 110 -// rustfmt-use_small_heuristics: Max -// rustfmt-hard_tabs: true -// rustfmt-use_field_init_shorthand: true -// rustfmt-overflow_delimited_expr: true +//@ rustfmt-max_width: 110 +//@ rustfmt-use_small_heuristics: Max +//@ rustfmt-hard_tabs: true +//@ rustfmt-use_field_init_shorthand: true +//@ rustfmt-overflow_delimited_expr: true // https://github.com/rust-lang/rustfmt/issues/4049 fn foo() { diff --git a/tests/target/issue_4057.rs b/tests/target/issue_4057.rs index 467e67bca7c..a890e1b3ef0 100644 --- a/tests/target/issue_4057.rs +++ b/tests/target/issue_4057.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true /// ``` /// # #[rustversion::since(1.36)] diff --git a/tests/target/issue_4579.rs b/tests/target/issue_4579.rs index 7b0a5f3a62e..7c3eb66bdfa 100644 --- a/tests/target/issue_4579.rs +++ b/tests/target/issue_4579.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true #[macro_export] macro_rules! main { diff --git a/tests/target/issue_4584.rs b/tests/target/issue_4584.rs index 20255beadb2..dc94d4e6d5b 100644 --- a/tests/target/issue_4584.rs +++ b/tests/target/issue_4584.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual #[derive(Debug)] pub enum Case { diff --git a/tests/target/issue_5027.rs b/tests/target/issue_5027.rs index 1de3e0d4f15..44580b04195 100644 --- a/tests/target/issue_5027.rs +++ b/tests/target/issue_5027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 pub type Iter<'a, D> = impl DoubleEndedIterator)> + ExactSizeIterator diff --git a/tests/target/issue_5399.rs b/tests/target/issue_5399.rs index 17364c38919..18df6cfb288 100644 --- a/tests/target/issue_5399.rs +++ b/tests/target/issue_5399.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 140 +//@ rustfmt-max_width: 140 impl NotificationRepository { fn set_status_changed( diff --git a/tests/target/issue_5533.rs b/tests/target/issue_5533.rs index c3095a44022..6e5f854761d 100644 --- a/tests/target/issue_5533.rs +++ b/tests/target/issue_5533.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true struct TestStruct { position_currency: String, // Currency for position of this contract. If not null, 1 contract = 1 positionCurrency. diff --git a/tests/target/issue_5907.rs b/tests/target/issue_5907.rs index 144de636b9b..ca00210e246 100644 --- a/tests/target/issue_5907.rs +++ b/tests/target/issue_5907.rs @@ -1,4 +1,4 @@ -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-format_code_in_doc_comments: true // ``` // [ diff --git a/tests/target/issue_5912.rs b/tests/target/issue_5912.rs index 835f2aba971..9c770e45b81 100644 --- a/tests/target/issue_5912.rs +++ b/tests/target/issue_5912.rs @@ -1,5 +1,5 @@ -// rustfmt-match_arm_blocks: false -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-match_arm_blocks: false +//@ rustfmt-control_brace_style: AlwaysNextLine fn foo() { match 0 diff --git a/tests/target/issue_5920_style_edition_2024.rs b/tests/target/issue_5920_style_edition_2024.rs index 1ca2b208dd6..efe2e915cd6 100644 --- a/tests/target/issue_5920_style_edition_2024.rs +++ b/tests/target/issue_5920_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 struct Demo { field_name_foo: (), diff --git a/tests/target/issue_5920_style_edition_2027.rs b/tests/target/issue_5920_style_edition_2027.rs index 9d040a37699..e1bccb7fdaf 100644 --- a/tests/target/issue_5920_style_edition_2027.rs +++ b/tests/target/issue_5920_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 struct Demo { field_name_foo: (), diff --git a/tests/target/issue_5982_style_edition_2024.rs b/tests/target/issue_5982_style_edition_2024.rs index fe5f4a8987c..74b53553471 100644 --- a/tests/target/issue_5982_style_edition_2024.rs +++ b/tests/target/issue_5982_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 struct Foo { #[cfg(all())] diff --git a/tests/target/issue_5982_style_edition_2027.rs b/tests/target/issue_5982_style_edition_2027.rs index f622cd89b47..b8ce33867df 100644 --- a/tests/target/issue_5982_style_edition_2027.rs +++ b/tests/target/issue_5982_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 struct Foo { #[cfg(all())] diff --git a/tests/target/issue_6121.rs b/tests/target/issue_6121.rs index 1339d6dc7ae..5e73acd72ee 100644 --- a/tests/target/issue_6121.rs +++ b/tests/target/issue_6121.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: true +//@ rustfmt-use_try_shorthand: true fn main() { let e: Result<(), &str> = Ok(()); diff --git a/tests/target/issue_6381_style_edition_2024.rs b/tests/target/issue_6381_style_edition_2024.rs index 360681502e1..a661fea901b 100644 --- a/tests/target/issue_6381_style_edition_2024.rs +++ b/tests/target/issue_6381_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn my_function_no_wrap_at_exactly_100_characters_wide( my_long_impl_trait_parameter: impl Into, diff --git a/tests/target/issue_6381_style_edition_2027.rs b/tests/target/issue_6381_style_edition_2027.rs index 75886cb51f4..b2795ea0a2f 100644 --- a/tests/target/issue_6381_style_edition_2027.rs +++ b/tests/target/issue_6381_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 fn my_function_no_wrap_at_exactly_100_characters_wide( my_long_impl_trait_parameter: impl Into, diff --git a/tests/target/issue_6801.rs b/tests/target/issue_6801.rs index 46372db4476..cbccebdfd6a 100644 --- a/tests/target/issue_6801.rs +++ b/tests/target/issue_6801.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: true -// rustfmt-comment_width: 80 -// rustfmt-max_width: 200 +//@ rustfmt-wrap_comments: true +//@ rustfmt-comment_width: 80 +//@ rustfmt-max_width: 200 fn foo() { // In this line, the next '.' is exactly at'comment_width' . diff --git a/tests/target/issue_6831_style_edition_2021.rs b/tests/target/issue_6831_style_edition_2021.rs index ce248f83572..d7837ac6da4 100644 --- a/tests/target/issue_6831_style_edition_2021.rs +++ b/tests/target/issue_6831_style_edition_2021.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2021 -// rustfmt-max_width: 100 +//@ rustfmt-style_edition: 2021 +//@ rustfmt-max_width: 100 impl IntoMessage< diff --git a/tests/target/issue_6831_style_edition_2024.rs b/tests/target/issue_6831_style_edition_2024.rs index 5fdb66edc89..c4e1a6e0788 100644 --- a/tests/target/issue_6831_style_edition_2024.rs +++ b/tests/target/issue_6831_style_edition_2024.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-max_width: 100 +//@ rustfmt-style_edition: 2024 +//@ rustfmt-max_width: 100 impl IntoMessage< diff --git a/tests/target/issue_6831_style_edition_2027.rs b/tests/target/issue_6831_style_edition_2027.rs index e0afea04b37..2c91bf7043f 100644 --- a/tests/target/issue_6831_style_edition_2027.rs +++ b/tests/target/issue_6831_style_edition_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-max_width: 100 +//@ rustfmt-style_edition: 2027 +//@ rustfmt-max_width: 100 impl IntoMessage< diff --git a/tests/target/issue_6859_hard_tab_breaks.rs b/tests/target/issue_6859_hard_tab_breaks.rs index c83dc3637b8..cfd4cf3edd0 100644 --- a/tests/target/issue_6859_hard_tab_breaks.rs +++ b/tests/target/issue_6859_hard_tab_breaks.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true fn testing() { let _ = some_long_name diff --git a/tests/target/issue_6984_style_edition_2024.rs b/tests/target/issue_6984_style_edition_2024.rs index 001d5cdf146..f78222181a9 100644 --- a/tests/target/issue_6984_style_edition_2024.rs +++ b/tests/target/issue_6984_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { let Demo { diff --git a/tests/target/issue_6984_style_edition_2027.rs b/tests/target/issue_6984_style_edition_2027.rs index eef2abc70cf..19be8cfb917 100644 --- a/tests/target/issue_6984_style_edition_2027.rs +++ b/tests/target/issue_6984_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 fn main() { let Demo { diff --git a/tests/target/issue_7003_style_edition_2024.rs b/tests/target/issue_7003_style_edition_2024.rs index f2e21df15da..464509a192b 100644 --- a/tests/target/issue_7003_style_edition_2024.rs +++ b/tests/target/issue_7003_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { _ = if let Some(term_node) = sema diff --git a/tests/target/issue_7003_style_edition_2027.rs b/tests/target/issue_7003_style_edition_2027.rs index c32a1278eae..1ea28ceeb4f 100644 --- a/tests/target/issue_7003_style_edition_2027.rs +++ b/tests/target/issue_7003_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 fn main() { _ = if let Some(term_node) = sema diff --git a/tests/target/issue_7055_style_edition_2024.rs b/tests/target/issue_7055_style_edition_2024.rs index 78504383254..1a5bd1661d5 100644 --- a/tests/target/issue_7055_style_edition_2024.rs +++ b/tests/target/issue_7055_style_edition_2024.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // The `removes_trailing_whitespace` case from the 2027 test is deliberately // absent here: at style editions before 2027 rustfmt fails with "left behind diff --git a/tests/target/issue_7055_style_edition_2027.rs b/tests/target/issue_7055_style_edition_2027.rs index 5a995b6a1e0..2eb84201596 100644 --- a/tests/target/issue_7055_style_edition_2027.rs +++ b/tests/target/issue_7055_style_edition_2027.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 struct S; diff --git a/tests/target/issue_7088_stable.rs b/tests/target/issue_7088_stable.rs index 80bffedc76f..ad749ad212f 100644 --- a/tests/target/issue_7088_stable.rs +++ b/tests/target/issue_7088_stable.rs @@ -1,4 +1,4 @@ -// rustfmt-stable: true +//@ rustfmt-stable: true // cfg_select! doesn't get formatted, but indentation is updated. diff --git a/tests/target/issue_7088_unstable.rs b/tests/target/issue_7088_unstable.rs index 03d3e63b472..789cd4f2ce9 100644 --- a/tests/target/issue_7088_unstable.rs +++ b/tests/target/issue_7088_unstable.rs @@ -1,4 +1,4 @@ -// rustfmt-unstable: true +//@ rustfmt-unstable: true #![crate_type = "lib"] cfg_select! { diff --git a/tests/target/item-brace-style-always-next-line.rs b/tests/target/item-brace-style-always-next-line.rs index 4935fac04f1..7c15c1839eb 100644 --- a/tests/target/item-brace-style-always-next-line.rs +++ b/tests/target/item-brace-style-always-next-line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: AlwaysNextLine +//@ rustfmt-brace_style: AlwaysNextLine mod M { diff --git a/tests/target/item-brace-style-prefer-same-line.rs b/tests/target/item-brace-style-prefer-same-line.rs index ef8dc028c2d..1780c84744d 100644 --- a/tests/target/item-brace-style-prefer-same-line.rs +++ b/tests/target/item-brace-style-prefer-same-line.rs @@ -1,4 +1,4 @@ -// rustfmt-brace_style: PreferSameLine +//@ rustfmt-brace_style: PreferSameLine mod M { enum A { diff --git a/tests/target/itemized-blocks/no_wrap.rs b/tests/target/itemized-blocks/no_wrap.rs index 86818b44745..e38327a1203 100644 --- a/tests/target/itemized-blocks/no_wrap.rs +++ b/tests/target/itemized-blocks/no_wrap.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_code_in_doc_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_code_in_doc_comments: true //! This is an itemized markdown list (see also issue #3224): //! * Outer diff --git a/tests/target/itemized-blocks/rewrite_fail.rs b/tests/target/itemized-blocks/rewrite_fail.rs index a118ef6faa1..b393dd4ffa4 100644 --- a/tests/target/itemized-blocks/rewrite_fail.rs +++ b/tests/target/itemized-blocks/rewrite_fail.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 50 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 50 // This example shows how to configure fern to // output really nicely colored logs diff --git a/tests/target/itemized-blocks/urls.rs b/tests/target/itemized-blocks/urls.rs index bc46ea47e16..4c28522229c 100644 --- a/tests/target/itemized-blocks/urls.rs +++ b/tests/target/itemized-blocks/urls.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 79 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 79 //! CMSIS: Cortex Microcontroller Software Interface Standard //! diff --git a/tests/target/itemized-blocks/wrap.rs b/tests/target/itemized-blocks/wrap.rs index 4826590ea59..72433d7f5a0 100644 --- a/tests/target/itemized-blocks/wrap.rs +++ b/tests/target/itemized-blocks/wrap.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: true -// rustfmt-format_code_in_doc_comments: true -// rustfmt-max_width: 50 +//@ rustfmt-wrap_comments: true +//@ rustfmt-format_code_in_doc_comments: true +//@ rustfmt-max_width: 50 //! This is an itemized markdown list (see also //! issue #3224): diff --git a/tests/target/lazy_static.rs b/tests/target/lazy_static.rs index b29ec9c1429..de824d1729f 100644 --- a/tests/target/lazy_static.rs +++ b/tests/target/lazy_static.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2027 +//@ rustfmt-style_edition: 2027 // Format `lazy_static!` and `lazy_static::lazy_static!`. lazy_static! { diff --git a/tests/target/let_chains.rs b/tests/target/let_chains.rs index 4fd6048d914..1440d17ade6 100644 --- a/tests/target/let_chains.rs +++ b/tests/target/let_chains.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2024 +//@ rustfmt-edition: 2024 fn main() { if let x = x diff --git a/tests/target/let_else.rs b/tests/target/let_else.rs index 528d2929734..8190073f144 100644 --- a/tests/target/let_else.rs +++ b/tests/target/let_else.rs @@ -1,4 +1,4 @@ -// rustfmt-single_line_let_else_max_width: 100 +//@ rustfmt-single_line_let_else_max_width: 100 fn main() { // Although this won't compile it still parses so make sure we can format empty else blocks diff --git a/tests/target/let_else_v2.rs b/tests/target/let_else_v2.rs index 6e886299cb0..e27da578aff 100644 --- a/tests/target/let_else_v2.rs +++ b/tests/target/let_else_v2.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-single_line_let_else_max_width: 100 +//@ rustfmt-style_edition: 2024 +//@ rustfmt-single_line_let_else_max_width: 100 fn issue5901() { #[cfg(target_os = "linux")] diff --git a/tests/target/long-fn-1/version_one.rs b/tests/target/long-fn-1/version_one.rs index 60f672c1837..f9da9965901 100644 --- a/tests/target/long-fn-1/version_one.rs +++ b/tests/target/long-fn-1/version_one.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/target/long-fn-1/version_two.rs b/tests/target/long-fn-1/version_two.rs index f6007398bcc..c6dfe1fe0b3 100644 --- a/tests/target/long-fn-1/version_two.rs +++ b/tests/target/long-fn-1/version_two.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // Tests that a function which is almost short enough, but not quite, gets // formatted correctly. diff --git a/tests/target/long-match-arms-brace-newline.rs b/tests/target/long-match-arms-brace-newline.rs index aeb384e7203..5f1cd30b6c3 100644 --- a/tests/target/long-match-arms-brace-newline.rs +++ b/tests/target/long-match-arms-brace-newline.rs @@ -1,6 +1,6 @@ -// rustfmt-format_strings: true -// rustfmt-max_width: 80 -// rustfmt-control_brace_style: AlwaysNextLine +//@ rustfmt-format_strings: true +//@ rustfmt-max_width: 80 +//@ rustfmt-control_brace_style: AlwaysNextLine fn main() { match x diff --git a/tests/target/long-use-statement-issue-3154.rs b/tests/target/long-use-statement-issue-3154.rs index 877241e3b6f..51c00e8b9d6 100644 --- a/tests/target/long-use-statement-issue-3154.rs +++ b/tests/target/long-use-statement-issue-3154.rs @@ -1,3 +1,3 @@ -// rustfmt-reorder_imports: false +//@ rustfmt-reorder_imports: false pub use self::super::super::super::root::mozilla::detail::StringClassFlags as nsTStringRepr_ClassFlags; diff --git a/tests/target/macro_rules.rs b/tests/target/macro_rules.rs index 97444aef404..daa5d71881f 100644 --- a/tests/target/macro_rules.rs +++ b/tests/target/macro_rules.rs @@ -1,4 +1,4 @@ -// rustfmt-format_macro_matchers: true +//@ rustfmt-format_macro_matchers: true macro_rules! m { () => {}; diff --git a/tests/target/macros.rs b/tests/target/macros.rs index a8275efbe99..a965bf853a6 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-format_macro_matchers: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-format_macro_matchers: true itemmacro!(this, is.now().formatted(yay)); itemmacro!( diff --git a/tests/target/markdown-comment-with-options.rs b/tests/target/markdown-comment-with-options.rs index ede2bc0d035..a3548d85e94 100644 --- a/tests/target/markdown-comment-with-options.rs +++ b/tests/target/markdown-comment-with-options.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true // Preserve two trailing whitespaces in doc comment, // but trim any whitespaces in normal comment. diff --git a/tests/target/match-block-trailing-comma.rs b/tests/target/match-block-trailing-comma.rs index 5ab433a2e6c..4aae891c2a1 100644 --- a/tests/target/match-block-trailing-comma.rs +++ b/tests/target/match-block-trailing-comma.rs @@ -1,4 +1,4 @@ -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-match_block_trailing_comma: true // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. diff --git a/tests/target/match-nowrap-trailing-comma.rs b/tests/target/match-nowrap-trailing-comma.rs index 19ef2144822..0f0e13e274c 100644 --- a/tests/target/match-nowrap-trailing-comma.rs +++ b/tests/target/match-nowrap-trailing-comma.rs @@ -1,5 +1,5 @@ -// rustfmt-match_arm_blocks: false -// rustfmt-match_block_trailing_comma: true +//@ rustfmt-match_arm_blocks: false +//@ rustfmt-match_block_trailing_comma: true // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. diff --git a/tests/target/match-nowrap.rs b/tests/target/match-nowrap.rs index 9e674b1e2f5..10af0ca426c 100644 --- a/tests/target/match-nowrap.rs +++ b/tests/target/match-nowrap.rs @@ -1,4 +1,4 @@ -// rustfmt-match_arm_blocks: false +//@ rustfmt-match_arm_blocks: false // Match expressions, no unwrapping of block arms or wrapping of multiline // expressions. diff --git a/tests/target/match.rs b/tests/target/match.rs index f751aea547a..106e4a46425 100644 --- a/tests/target/match.rs +++ b/tests/target/match.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true // Match expressions. fn foo() { diff --git a/tests/target/match_overflow_expr.rs b/tests/target/match_overflow_expr.rs index b817879d1f4..234d0a59734 100644 --- a/tests/target/match_overflow_expr.rs +++ b/tests/target/match_overflow_expr.rs @@ -1,4 +1,4 @@ -// rustfmt-overflow_delimited_expr: true +//@ rustfmt-overflow_delimited_expr: true fn main() { println!("Foobar: {}", match "input" { diff --git a/tests/target/max-line-length-in-chars.rs b/tests/target/max-line-length-in-chars.rs index d49fbb7e30e..d5aeb75a732 100644 --- a/tests/target/max-line-length-in-chars.rs +++ b/tests/target/max-line-length-in-chars.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 25 +//@ rustfmt-max_width: 25 // абвгдеёжзийклмнопрст fn main() {} diff --git a/tests/target/merge_imports_true_compat.rs b/tests/target/merge_imports_true_compat.rs index 46cd0a3b8a0..386f3f8ee3b 100644 --- a/tests/target/merge_imports_true_compat.rs +++ b/tests/target/merge_imports_true_compat.rs @@ -1,3 +1,3 @@ -// rustfmt-merge_imports: true +//@ rustfmt-merge_imports: true use a::{b, c}; diff --git a/tests/target/mod_skip_child.rs b/tests/target/mod_skip_child.rs index d48c4a37e81..59157d1ec9c 100644 --- a/tests/target/mod_skip_child.rs +++ b/tests/target/mod_skip_child.rs @@ -1,2 +1,2 @@ -// rustfmt-skip_children: true +//@ rustfmt-skip_children: true mod nested_skipped; diff --git a/tests/target/multiple.rs b/tests/target/multiple.rs index d2b9789930b..1ea0af77400 100644 --- a/tests/target/multiple.rs +++ b/tests/target/multiple.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-format_strings: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-format_strings: true // Test of lots of random stuff. // FIXME split this into multiple, self-contained tests. diff --git a/tests/target/non_ascii_numerics_import_asciibetically.rs b/tests/target/non_ascii_numerics_import_asciibetically.rs index 1e5718a01ff..83c8d15ed2d 100644 --- a/tests/target/non_ascii_numerics_import_asciibetically.rs +++ b/tests/target/non_ascii_numerics_import_asciibetically.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // ascii-betically sorted pub use print0msg; diff --git a/tests/target/non_ascii_numerics_import_versionsort.rs b/tests/target/non_ascii_numerics_import_versionsort.rs index 88b5dff8177..0519cdcdf0f 100644 --- a/tests/target/non_ascii_numerics_import_versionsort.rs +++ b/tests/target/non_ascii_numerics_import_versionsort.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // versionsorted pub use print0msg; diff --git a/tests/target/normalize_doc_attributes_should_not_imply_format_doc_comments.rs b/tests/target/normalize_doc_attributes_should_not_imply_format_doc_comments.rs index 562d9565e9a..783de117e87 100644 --- a/tests/target/normalize_doc_attributes_should_not_imply_format_doc_comments.rs +++ b/tests/target/normalize_doc_attributes_should_not_imply_format_doc_comments.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-normalize_doc_attributes: true /// Foo /// diff --git a/tests/target/normalize_multiline_doc_attribute.rs b/tests/target/normalize_multiline_doc_attribute.rs index 890c9bb20cd..706717a212d 100644 --- a/tests/target/normalize_multiline_doc_attribute.rs +++ b/tests/target/normalize_multiline_doc_attribute.rs @@ -1,5 +1,5 @@ -// rustfmt-unstable: true -// rustfmt-normalize_doc_attributes: true +//@ rustfmt-unstable: true +//@ rustfmt-normalize_doc_attributes: true ///This comment ///is split diff --git a/tests/target/one_line_if_v1.rs b/tests/target/one_line_if_v1.rs index 5160ea0264c..ce62af26737 100644 --- a/tests/target/one_line_if_v1.rs +++ b/tests/target/one_line_if_v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 fn plain_if(x: bool) -> u8 { if x { diff --git a/tests/target/one_line_if_v2.rs b/tests/target/one_line_if_v2.rs index a9610ec9749..44b337c336a 100644 --- a/tests/target/one_line_if_v2.rs +++ b/tests/target/one_line_if_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn plain_if(x: bool) -> u8 { if x { 0 } else { 1 } diff --git a/tests/target/path_clarity/foo.rs b/tests/target/path_clarity/foo.rs index cd247fabfe3..262c2232ea3 100644 --- a/tests/target/path_clarity/foo.rs +++ b/tests/target/path_clarity/foo.rs @@ -1,2 +1,2 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 mod bar; diff --git a/tests/target/paths.rs b/tests/target/paths.rs index 0d2ba797eb7..4fd21865ffe 100644 --- a/tests/target/paths.rs +++ b/tests/target/paths.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn main() { let constellation_chan = diff --git a/tests/target/pattern-condense-wildcards.rs b/tests/target/pattern-condense-wildcards.rs index a85a16004ad..16090aedd8e 100644 --- a/tests/target/pattern-condense-wildcards.rs +++ b/tests/target/pattern-condense-wildcards.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-condense_wildcard_suffixes: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-condense_wildcard_suffixes: true fn main() { match x { diff --git a/tests/target/pattern.rs b/tests/target/pattern.rs index 483725f95c4..c951c16956b 100644 --- a/tests/target/pattern.rs +++ b/tests/target/pattern.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true #![feature(exclusive_range_pattern)] use core::u8::MAX; diff --git a/tests/target/preserves_carriage_return_for_unix.rs b/tests/target/preserves_carriage_return_for_unix.rs index e5e0b286598..a3baa9055dc 100644 --- a/tests/target/preserves_carriage_return_for_unix.rs +++ b/tests/target/preserves_carriage_return_for_unix.rs @@ -1,2 +1,3 @@ -// rustfmt-newline_style: Unix -// Foo Bar +//@ rustfmt-newline_style: Unix +// Foo +struct Bar; diff --git a/tests/target/preserves_carriage_return_for_windows.rs b/tests/target/preserves_carriage_return_for_windows.rs index 1085360ee59..ac4725dd649 100644 --- a/tests/target/preserves_carriage_return_for_windows.rs +++ b/tests/target/preserves_carriage_return_for_windows.rs @@ -1,2 +1,3 @@ -// rustfmt-newline_style: Windows -// Foo Bar +//@ rustfmt-newline_style: Windows +// Foo +struct Bar; diff --git a/tests/target/raw-lifetimes.rs b/tests/target/raw-lifetimes.rs index 62fb9be6882..89b62e843a2 100644 --- a/tests/target/raw-lifetimes.rs +++ b/tests/target/raw-lifetimes.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2021 +//@ rustfmt-edition: 2021 // Simple idempotence test for raw lifetimes. diff --git a/tests/target/reorder-impl-items.rs b/tests/target/reorder-impl-items.rs index 16efff55b06..a868e60db10 100644 --- a/tests/target/reorder-impl-items.rs +++ b/tests/target/reorder-impl-items.rs @@ -1,4 +1,4 @@ -// rustfmt-reorder_impl_items: true +//@ rustfmt-reorder_impl_items: true // The ordering of the following impl items should be idempotent. impl<'a> Command<'a> { diff --git a/tests/target/reorder_modules/disabled_style_edition_2024.rs b/tests/target/reorder_modules/disabled_style_edition_2024.rs index 0c59d4739fc..2bd635dbf9c 100644 --- a/tests/target/reorder_modules/disabled_style_edition_2024.rs +++ b/tests/target/reorder_modules/disabled_style_edition_2024.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-reorder_modules: false +//@ rustfmt-style_edition: 2024 +//@ rustfmt-reorder_modules: false mod x86; mod v0s; diff --git a/tests/target/reorder_modules/disabled_style_edition_2027.rs b/tests/target/reorder_modules/disabled_style_edition_2027.rs index 4695b06c77b..b760c81e834 100644 --- a/tests/target/reorder_modules/disabled_style_edition_2027.rs +++ b/tests/target/reorder_modules/disabled_style_edition_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-reorder_modules: false +//@ rustfmt-style_edition: 2027 +//@ rustfmt-reorder_modules: false mod x86; mod v0s; diff --git a/tests/target/reorder_modules/enabled_style_edition_2015.rs b/tests/target/reorder_modules/enabled_style_edition_2015.rs index a61f576eccf..03a8a86572b 100644 --- a/tests/target/reorder_modules/enabled_style_edition_2015.rs +++ b/tests/target/reorder_modules/enabled_style_edition_2015.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2015 -// rustfmt-reorder_modules: true +//@ rustfmt-style_edition: 2015 +//@ rustfmt-reorder_modules: true mod A2; mod ABCD; diff --git a/tests/target/reorder_modules/enabled_style_edition_2024.rs b/tests/target/reorder_modules/enabled_style_edition_2024.rs index 852e40f213d..7452b31c398 100644 --- a/tests/target/reorder_modules/enabled_style_edition_2024.rs +++ b/tests/target/reorder_modules/enabled_style_edition_2024.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-reorder_modules: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-reorder_modules: true mod A2; mod ABCD; diff --git a/tests/target/reorder_modules/enabled_style_edition_2027.rs b/tests/target/reorder_modules/enabled_style_edition_2027.rs index bcca31f4023..7bca9461168 100644 --- a/tests/target/reorder_modules/enabled_style_edition_2027.rs +++ b/tests/target/reorder_modules/enabled_style_edition_2027.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2027 -// rustfmt-reorder_modules: true +//@ rustfmt-style_edition: 2027 +//@ rustfmt-reorder_modules: true mod _ZYXW; mod _abcd; diff --git a/tests/target/single-line-macro/v1.rs b/tests/target/single-line-macro/v1.rs index fea146d8d33..9861eff277d 100644 --- a/tests/target/single-line-macro/v1.rs +++ b/tests/target/single-line-macro/v1.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2015 +//@ rustfmt-style_edition: 2015 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/target/single-line-macro/v2.rs b/tests/target/single-line-macro/v2.rs index 6fcacb70ba3..bb731ba5e20 100644 --- a/tests/target/single-line-macro/v2.rs +++ b/tests/target/single-line-macro/v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 // #2652 // Preserve trailing comma inside macro, even if it looks an array. diff --git a/tests/target/skip_macro_invocations/all.rs b/tests/target/skip_macro_invocations/all.rs index d0437ee10fd..7194f125e91 100644 --- a/tests/target/skip_macro_invocations/all.rs +++ b/tests/target/skip_macro_invocations/all.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["*"] +//@ rustfmt-skip_macro_invocations: ["*"] // Should skip this invocation items!( diff --git a/tests/target/skip_macro_invocations/all_and_name.rs b/tests/target/skip_macro_invocations/all_and_name.rs index 1f6722344fe..59698b8917b 100644 --- a/tests/target/skip_macro_invocations/all_and_name.rs +++ b/tests/target/skip_macro_invocations/all_and_name.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["*","items"] +//@ rustfmt-skip_macro_invocations: ["*","items"] // Should skip this invocation items!( diff --git a/tests/target/skip_macro_invocations/config_file.rs b/tests/target/skip_macro_invocations/config_file.rs index 008e28db42d..d1f4ea39de3 100644 --- a/tests/target/skip_macro_invocations/config_file.rs +++ b/tests/target/skip_macro_invocations/config_file.rs @@ -1,5 +1,5 @@ -// rustfmt-unstable: true -// rustfmt-config: issue-5816.toml +//@ rustfmt-unstable: true +//@ rustfmt-config: issue-5816.toml fn main() { println!( "Hello, world!"); diff --git a/tests/target/skip_macro_invocations/empty.rs b/tests/target/skip_macro_invocations/empty.rs index 4a398cc59c6..041907b12f3 100644 --- a/tests/target/skip_macro_invocations/empty.rs +++ b/tests/target/skip_macro_invocations/empty.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: [] +//@ rustfmt-skip_macro_invocations: [] // Should not skip this invocation items!( diff --git a/tests/target/skip_macro_invocations/name.rs b/tests/target/skip_macro_invocations/name.rs index c4d577269c6..e1af85a4533 100644 --- a/tests/target/skip_macro_invocations/name.rs +++ b/tests/target/skip_macro_invocations/name.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["items"] +//@ rustfmt-skip_macro_invocations: ["items"] // Should skip this invocation items!( diff --git a/tests/target/skip_macro_invocations/name_unknown.rs b/tests/target/skip_macro_invocations/name_unknown.rs index 7ab1440395c..1263bdbd644 100644 --- a/tests/target/skip_macro_invocations/name_unknown.rs +++ b/tests/target/skip_macro_invocations/name_unknown.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["unknown"] +//@ rustfmt-skip_macro_invocations: ["unknown"] // Should not skip this invocation items!( diff --git a/tests/target/skip_macro_invocations/names.rs b/tests/target/skip_macro_invocations/names.rs index c6b41ff93d7..006508c69f0 100644 --- a/tests/target/skip_macro_invocations/names.rs +++ b/tests/target/skip_macro_invocations/names.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["foo","bar"] +//@ rustfmt-skip_macro_invocations: ["foo","bar"] // Should skip this invocation foo!( diff --git a/tests/target/skip_macro_invocations/path_qualified_invocation_mismatch.rs b/tests/target/skip_macro_invocations/path_qualified_invocation_mismatch.rs index 6e372c72695..04eaebfa636 100644 --- a/tests/target/skip_macro_invocations/path_qualified_invocation_mismatch.rs +++ b/tests/target/skip_macro_invocations/path_qualified_invocation_mismatch.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["items"] +//@ rustfmt-skip_macro_invocations: ["items"] // Should not skip this invocation self::items!( diff --git a/tests/target/skip_macro_invocations/path_qualified_match.rs b/tests/target/skip_macro_invocations/path_qualified_match.rs index 9398918a9e1..0b88aa6ab2c 100644 --- a/tests/target/skip_macro_invocations/path_qualified_match.rs +++ b/tests/target/skip_macro_invocations/path_qualified_match.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["self::items"] +//@ rustfmt-skip_macro_invocations: ["self::items"] // Should skip this invocation self::items!( diff --git a/tests/target/skip_macro_invocations/path_qualified_name_mismatch.rs b/tests/target/skip_macro_invocations/path_qualified_name_mismatch.rs index aa57a2a655c..62e43f352a7 100644 --- a/tests/target/skip_macro_invocations/path_qualified_name_mismatch.rs +++ b/tests/target/skip_macro_invocations/path_qualified_name_mismatch.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["self::items"] +//@ rustfmt-skip_macro_invocations: ["self::items"] // Should not skip this invocation items!( diff --git a/tests/target/skip_macro_invocations/use_alias_examples.rs b/tests/target/skip_macro_invocations/use_alias_examples.rs index 799dd8c08af..e673e279dc9 100644 --- a/tests/target/skip_macro_invocations/use_alias_examples.rs +++ b/tests/target/skip_macro_invocations/use_alias_examples.rs @@ -1,4 +1,4 @@ -// rustfmt-skip_macro_invocations: ["aaa","ccc"] +//@ rustfmt-skip_macro_invocations: ["aaa","ccc"] // These tests demonstrate a realistic use case with use aliases. // The use statements should not impact functionality in any way. diff --git a/tests/target/soft-wrapping.rs b/tests/target/soft-wrapping.rs index 5b4c6d9e85a..89fb697f4d9 100644 --- a/tests/target/soft-wrapping.rs +++ b/tests/target/soft-wrapping.rs @@ -1,5 +1,5 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 80 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 80 // Soft wrapping for comments. // #535, soft wrapping for comments diff --git a/tests/target/spaces-around-ranges.rs b/tests/target/spaces-around-ranges.rs index b53e5b58b8c..161205a3bb5 100644 --- a/tests/target/spaces-around-ranges.rs +++ b/tests/target/spaces-around-ranges.rs @@ -1,4 +1,4 @@ -// rustfmt-spaces_around_ranges: true +//@ rustfmt-spaces_around_ranges: true fn bar(v: &[u8]) {} diff --git a/tests/target/string-lit.rs b/tests/target/string-lit.rs index 2d33061074d..2ab9ec876fc 100644 --- a/tests/target/string-lit.rs +++ b/tests/target/string-lit.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true // Long string literals fn main() -> &'static str { diff --git a/tests/target/string_lit_unicode_ws.rs b/tests/target/string_lit_unicode_ws.rs index fff135fbc4f..f5f9c9703fd 100644 --- a/tests/target/string_lit_unicode_ws.rs +++ b/tests/target/string_lit_unicode_ws.rs @@ -1,4 +1,4 @@ -// rustfmt-show_parse_errors: false +//@ rustfmt-show_parse_errors: false // Test Unicode whitespace characters in string literal line continuation fn main() { diff --git a/tests/target/string_punctuation.rs b/tests/target/string_punctuation.rs index 0b8ec1b7f39..6632cddbc2c 100644 --- a/tests/target/string_punctuation.rs +++ b/tests/target/string_punctuation.rs @@ -1,4 +1,4 @@ -// rustfmt-format_strings: true +//@ rustfmt-format_strings: true fn main() { println!( diff --git a/tests/target/struct_lits.rs b/tests/target/struct_lits.rs index d3bc364c350..b7ae2efc8b6 100644 --- a/tests/target/struct_lits.rs +++ b/tests/target/struct_lits.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true // Struct literal expressions. fn main() { diff --git a/tests/target/struct_lits_multiline.rs b/tests/target/struct_lits_multiline.rs index b29aafd0548..92c9c4c2b28 100644 --- a/tests/target/struct_lits_multiline.rs +++ b/tests/target/struct_lits_multiline.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-struct_lit_single_line: false +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-struct_lit_single_line: false // Struct literal expressions. diff --git a/tests/target/struct_lits_visual.rs b/tests/target/struct_lits_visual.rs index a9627fb90f5..7c0318a0a74 100644 --- a/tests/target/struct_lits_visual.rs +++ b/tests/target/struct_lits_visual.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-indent_style: Visual +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-indent_style: Visual // Struct literal expressions. diff --git a/tests/target/struct_lits_visual_multiline.rs b/tests/target/struct_lits_visual_multiline.rs index 3f43ef0c981..13e7900faab 100644 --- a/tests/target/struct_lits_visual_multiline.rs +++ b/tests/target/struct_lits_visual_multiline.rs @@ -1,7 +1,7 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-indent_style: Visual -// rustfmt-struct_lit_single_line: false +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-indent_style: Visual +//@ rustfmt-struct_lit_single_line: false // Struct literal expressions. diff --git a/tests/target/struct_tuple_visual.rs b/tests/target/struct_tuple_visual.rs index f95f3fe4fd3..de2a4c7bb00 100644 --- a/tests/target/struct_tuple_visual.rs +++ b/tests/target/struct_tuple_visual.rs @@ -1,6 +1,6 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true -// rustfmt-indent_style: Visual +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true +//@ rustfmt-indent_style: Visual fn foo() { Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(f(), b()); diff --git a/tests/target/structs.rs b/tests/target/structs.rs index 4948e37a5a3..7f26e8a3f16 100644 --- a/tests/target/structs.rs +++ b/tests/target/structs.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true /// A Doc comment #[AnAttribute] diff --git a/tests/target/style_edition/follows_edition.rs b/tests/target/style_edition/follows_edition.rs index c36a993d842..ed74c10e069 100644 --- a/tests/target/style_edition/follows_edition.rs +++ b/tests/target/style_edition/follows_edition.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2024 +//@ rustfmt-edition: 2024 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, diff --git a/tests/target/style_edition/overrides_edition_when_set.rs b/tests/target/style_edition/overrides_edition_when_set.rs index 6d0eaac8970..97b5007ab4d 100644 --- a/tests/target/style_edition/overrides_edition_when_set.rs +++ b/tests/target/style_edition/overrides_edition_when_set.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2018 -// rustfmt-style_edition: 2024 +//@ rustfmt-edition: 2018 +//@ rustfmt-style_edition: 2024 fn build_sorted_static_get_entry_names( mut entries: Vec<(u8, &'static str)>, ) -> ( diff --git a/tests/target/trailing-comma-never.rs b/tests/target/trailing-comma-never.rs index ea199f5ff29..841a729a546 100644 --- a/tests/target/trailing-comma-never.rs +++ b/tests/target/trailing-comma-never.rs @@ -1,4 +1,4 @@ -// rustfmt-trailing_comma: Never +//@ rustfmt-trailing_comma: Never enum X { A, diff --git a/tests/target/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs b/tests/target/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs index 074d2dcdd6a..b793a7b68e4 100644 --- a/tests/target/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs +++ b/tests/target/trailing-semicolon/loop-bodies-edition-2021-style-edition-2027.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2021 -// rustfmt-style_edition: 2027 +//@ rustfmt-edition: 2021 +//@ rustfmt-style_edition: 2027 fn main() { loop { diff --git a/tests/target/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs b/tests/target/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs index 4f0b380c3a5..97e4670ff3c 100644 --- a/tests/target/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs +++ b/tests/target/trailing-semicolon/loop-bodies-edition-2024-style-edition-2024.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2024 +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2024 fn main() { loop { diff --git a/tests/target/trailing-semicolon/loop-bodies.rs b/tests/target/trailing-semicolon/loop-bodies.rs index eec680d216b..5fc2b9d07ce 100644 --- a/tests/target/trailing-semicolon/loop-bodies.rs +++ b/tests/target/trailing-semicolon/loop-bodies.rs @@ -1,5 +1,5 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2027 +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2027 macro_rules! dummy { () => {}; diff --git a/tests/target/trailing_commas.rs b/tests/target/trailing_commas.rs index 06f0a13b10c..08a4709121d 100644 --- a/tests/target/trailing_commas.rs +++ b/tests/target/trailing_commas.rs @@ -1,5 +1,5 @@ -// rustfmt-match_block_trailing_comma: true -// rustfmt-trailing_comma: Always +//@ rustfmt-match_block_trailing_comma: true +//@ rustfmt-trailing_comma: Always fn main() { match foo { diff --git a/tests/target/trailing_comments/hard_tabs.rs b/tests/target/trailing_comments/hard_tabs.rs index 8135b1a8caf..c2e2a5fdd04 100644 --- a/tests/target/trailing_comments/hard_tabs.rs +++ b/tests/target/trailing_comments/hard_tabs.rs @@ -1,6 +1,6 @@ -// rustfmt-style_edition: 2024 -// rustfmt-wrap_comments: true -// rustfmt-hard_tabs: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-wrap_comments: true +//@ rustfmt-hard_tabs: true impl Foo { fn foo() { diff --git a/tests/target/trailing_comments/soft_tabs.rs b/tests/target/trailing_comments/soft_tabs.rs index 3e2dbc1bb7d..fcb6e5027c0 100644 --- a/tests/target/trailing_comments/soft_tabs.rs +++ b/tests/target/trailing_comments/soft_tabs.rs @@ -1,5 +1,5 @@ -// rustfmt-style_edition: 2024 -// rustfmt-wrap_comments: true +//@ rustfmt-style_edition: 2024 +//@ rustfmt-wrap_comments: true pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast // Multicast using broadcst. add. diff --git a/tests/target/try-conversion.rs b/tests/target/try-conversion.rs index 04992a0a0f6..a881c43cfbf 100644 --- a/tests/target/try-conversion.rs +++ b/tests/target/try-conversion.rs @@ -1,4 +1,4 @@ -// rustfmt-use_try_shorthand: true +//@ rustfmt-use_try_shorthand: true fn main() { let x = some_expr()?; diff --git a/tests/target/try_block.rs b/tests/target/try_block.rs index f9d9909f524..ebab6f8d2ef 100644 --- a/tests/target/try_block.rs +++ b/tests/target/try_block.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(try_blocks)] fn main() -> Result<(), !> { diff --git a/tests/target/try_blocks_heterogeneous.rs b/tests/target/try_blocks_heterogeneous.rs index ce0a3cf704b..48837bd663a 100644 --- a/tests/target/try_blocks_heterogeneous.rs +++ b/tests/target/try_blocks_heterogeneous.rs @@ -1,4 +1,4 @@ -// rustfmt-edition: 2018 +//@ rustfmt-edition: 2018 #![feature(try_blocks_heterogeneous)] fn main() -> Result<(), !> { diff --git a/tests/target/tuple_v2.rs b/tests/target/tuple_v2.rs index fa508332be5..d69c46ad9f2 100644 --- a/tests/target/tuple_v2.rs +++ b/tests/target/tuple_v2.rs @@ -1,4 +1,4 @@ -// rustfmt-style_edition: 2024 +//@ rustfmt-style_edition: 2024 fn issue_4355() { let _ = ((1,),).0.0; diff --git a/tests/target/type.rs b/tests/target/type.rs index 4855f726ea3..b9d822e1b3e 100644 --- a/tests/target/type.rs +++ b/tests/target/type.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true fn types() { let x: [Vec<_>] = []; let y: *mut [SomeType; konst_funk()] = expr(); diff --git a/tests/target/type_alias.rs b/tests/target/type_alias.rs index 862f9ecbeec..cfd1fc52ab1 100644 --- a/tests/target/type_alias.rs +++ b/tests/target/type_alias.rs @@ -1,4 +1,4 @@ -// rustfmt-normalize_comments: true +//@ rustfmt-normalize_comments: true type PrivateTest<'a, I> = ( Box + 'a>, diff --git a/tests/target/unicode.rs b/tests/target/unicode.rs index 610e482d6b4..f18647233fb 100644 --- a/tests/target/unicode.rs +++ b/tests/target/unicode.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true fn foo() { let s = "this line goes to 100: ͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶͶ"; diff --git a/tests/target/unions.rs b/tests/target/unions.rs index 8ed16b269c2..df27718ae2d 100644 --- a/tests/target/unions.rs +++ b/tests/target/unions.rs @@ -1,5 +1,5 @@ -// rustfmt-normalize_comments: true -// rustfmt-wrap_comments: true +//@ rustfmt-normalize_comments: true +//@ rustfmt-wrap_comments: true /// A Doc comment #[AnAttribute] diff --git a/tests/target/use-identifier-order-mixed-edition.rs b/tests/target/use-identifier-order-mixed-edition.rs index d1a49641e01..ac87a7fe59f 100644 --- a/tests/target/use-identifier-order-mixed-edition.rs +++ b/tests/target/use-identifier-order-mixed-edition.rs @@ -1,6 +1,6 @@ -// rustfmt-edition: 2024 -// rustfmt-style_edition: 2021 -// rustfmt-reorder_imports: true +//@ rustfmt-edition: 2024 +//@ rustfmt-style_edition: 2021 +//@ rustfmt-reorder_imports: true use a::{or_quietly, small, t_i_n_y, Big, OrInTheMiddle, HUGE, SCREAMING_LOUDLY}; diff --git a/tests/target/use-identifier-order.rs b/tests/target/use-identifier-order.rs index d0ae3539189..07450a6e43d 100644 --- a/tests/target/use-identifier-order.rs +++ b/tests/target/use-identifier-order.rs @@ -1,6 +1,6 @@ -// rustfmt-edition: 2021 -// rustfmt-style_edition: 2021 -// rustfmt-reorder_imports: true +//@ rustfmt-edition: 2021 +//@ rustfmt-style_edition: 2021 +//@ rustfmt-reorder_imports: true use a::{or_quietly, small, t_i_n_y, Big, OrInTheMiddle, HUGE, SCREAMING_LOUDLY}; diff --git a/tests/target/visual-fn-type.rs b/tests/target/visual-fn-type.rs index 052acde0209..5e3c34f5d23 100644 --- a/tests/target/visual-fn-type.rs +++ b/tests/target/visual-fn-type.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual type CNodeSetAtts = unsafe extern "C" fn(node: *const RsvgNode, node_impl: *const RsvgCNodeImpl, handle: *const RsvgHandle, diff --git a/tests/target/where-clause-comment-wrap-issue-7148.rs b/tests/target/where-clause-comment-wrap-issue-7148.rs index 08f3d3e4312..504a9c19101 100644 --- a/tests/target/where-clause-comment-wrap-issue-7148.rs +++ b/tests/target/where-clause-comment-wrap-issue-7148.rs @@ -1,6 +1,6 @@ -// rustfmt-wrap_comments: true -// rustfmt-max_width: 100 -// rustfmt-comment_width: 100 +//@ rustfmt-wrap_comments: true +//@ rustfmt-max_width: 100 +//@ rustfmt-comment_width: 100 // Comments between `where` and the first predicate should be formatted using // the full column budget rather than a budget derived from the header width. diff --git a/tests/target/where-clause.rs b/tests/target/where-clause.rs index eb2f8d5e6e8..20f9a2019e2 100644 --- a/tests/target/where-clause.rs +++ b/tests/target/where-clause.rs @@ -1,4 +1,4 @@ -// rustfmt-indent_style: Visual +//@ rustfmt-indent_style: Visual fn reflow_list_node_with_rule(node: &CompoundNode, rule: &Rule, args: &[Arg], shape: &Shape) where T: FOo, diff --git a/tests/target/width-heuristics.rs b/tests/target/width-heuristics.rs index e177a2152e8..6518d15020f 100644 --- a/tests/target/width-heuristics.rs +++ b/tests/target/width-heuristics.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 120 +//@ rustfmt-max_width: 120 // elems on multiple lines for max_width 100, but same line for max_width 120 fn foo(e: Enum) { diff --git a/tests/target/wrap_comments_should_not_imply_format_doc_comments.rs b/tests/target/wrap_comments_should_not_imply_format_doc_comments.rs index 6ccecc7e0bb..9bec6256a12 100644 --- a/tests/target/wrap_comments_should_not_imply_format_doc_comments.rs +++ b/tests/target/wrap_comments_should_not_imply_format_doc_comments.rs @@ -1,4 +1,4 @@ -// rustfmt-wrap_comments: true +//@ rustfmt-wrap_comments: true /// Foo /// diff --git a/tests/warning/source/issue_3950.rs b/tests/warning/source/issue_3950.rs index 5fa559f5d98..61b33f995ba 100644 --- a/tests/warning/source/issue_3950.rs +++ b/tests/warning/source/issue_3950.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true fn lorem_ipsum() { let f = bar(); // Donec consequat mi. Quisque vitae dolor. Integer lobortis. Maecenas id nulla. Lorem. diff --git a/tests/warning/source/issue_4968.rs b/tests/warning/source/issue_4968.rs index 3726abc694b..1903cdec859 100644 --- a/tests/warning/source/issue_4968.rs +++ b/tests/warning/source/issue_4968.rs @@ -1,5 +1,5 @@ -// rustfmt-hard_tabs: true -// rustfmt-max_width: 40 +//@ rustfmt-hard_tabs: true +//@ rustfmt-max_width: 40 fn foo(x: u32) { if x > 10 { diff --git a/tests/warning/source/issue_6442.rs b/tests/warning/source/issue_6442.rs index f3760c97231..f67bce48002 100644 --- a/tests/warning/source/issue_6442.rs +++ b/tests/warning/source/issue_6442.rs @@ -1,4 +1,4 @@ -// rustfmt-hard_tabs: true +//@ rustfmt-hard_tabs: true fn main() { // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/tests/warning/source/issue_6850.rs b/tests/warning/source/issue_6850.rs index 1f130a43cbf..356cd5deb2c 100644 --- a/tests/warning/source/issue_6850.rs +++ b/tests/warning/source/issue_6850.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 50 +//@ rustfmt-max_width: 50 fn main() { "☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃"; } diff --git a/tests/warning/source/line_overflow_tabs.rs b/tests/warning/source/line_overflow_tabs.rs index e6a2a515ffb..7cf3c5ff63d 100644 --- a/tests/warning/source/line_overflow_tabs.rs +++ b/tests/warning/source/line_overflow_tabs.rs @@ -1,4 +1,4 @@ -// rustfmt-max_width: 50 +//@ rustfmt-max_width: 50 fn main() { let s = " "; } diff --git a/tests/warning/source/line_overflow_with_trailing_whitespace.rs b/tests/warning/source/line_overflow_with_trailing_whitespace.rs index ccb2ece8668..c99cf25d518 100644 --- a/tests/warning/source/line_overflow_with_trailing_whitespace.rs +++ b/tests/warning/source/line_overflow_with_trailing_whitespace.rs @@ -1,3 +1,3 @@ -// rustfmt-max_width: 50 +//@ rustfmt-max_width: 50 /// This doc comment overflows and has trailing space. fn main() {} diff --git a/tests/warning/source/trailing_whitespace_overflow.rs b/tests/warning/source/trailing_whitespace_overflow.rs index 16be61a5e3c..5167fdc1a50 100644 --- a/tests/warning/source/trailing_whitespace_overflow.rs +++ b/tests/warning/source/trailing_whitespace_overflow.rs @@ -1,3 +1,3 @@ -// rustfmt-max_width: 50 +//@ rustfmt-max_width: 50 /// Overflowing trailing whitespace. fn main() {} diff --git a/tests/writemode/source/fn-single-line.rs b/tests/writemode/source/fn-single-line.rs index ab1e13e17a7..af0cab4465f 100644 --- a/tests/writemode/source/fn-single-line.rs +++ b/tests/writemode/source/fn-single-line.rs @@ -1,5 +1,5 @@ -// rustfmt-fn_single_line: true -// rustfmt-emit_mode: checkstyle +//@ rustfmt-fn_single_line: true +//@ rustfmt-emit_mode: checkstyle // Test single-line functions. fn foo_expr() { diff --git a/tests/writemode/source/json.rs b/tests/writemode/source/json.rs index 89dcf694183..a39e4e26578 100644 --- a/tests/writemode/source/json.rs +++ b/tests/writemode/source/json.rs @@ -1,5 +1,5 @@ -// rustfmt-fn_single_line: true -// rustfmt-emit_mode: json +//@ rustfmt-fn_single_line: true +//@ rustfmt-emit_mode: json // Test single-line functions. fn foo_expr() { diff --git a/tests/writemode/source/modified.rs b/tests/writemode/source/modified.rs index 948beb348db..9c6e9e51256 100644 --- a/tests/writemode/source/modified.rs +++ b/tests/writemode/source/modified.rs @@ -1,4 +1,4 @@ -// rustfmt-write_mode: modified +//@ rustfmt-write_mode: modified // Test "modified" output fn From 4549cdc6ae7cb86fad7664c9a41049dd1998b53f Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Tue, 6 Oct 2026 23:54:00 -0400 Subject: [PATCH 2/5] test: read_significant_comments regex now matches `//@rustfmt-{option}: {value}` Panics if a test directive is malformed. --- src/test/mod.rs | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/test/mod.rs b/src/test/mod.rs index 5f7f4ca7c73..8ed88d3bf23 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -990,32 +990,24 @@ fn read_significant_comments(file_name: &Path) -> HashMap { let file = fs::File::open(file_name) .unwrap_or_else(|_| panic!("couldn't read file {}", file_name.display())); let reader = BufReader::new(file); - let pattern = r"^\s*//\s*rustfmt-([^:]+):\s*(\S+)"; + // Matches `//@ rustfmt-{name}: {value}` + let pattern = r"^\s*//@\s+rustfmt-(?P[A-Za-z_]+)\s?:\s*(?P\S+)$"; let regex = regex::Regex::new(pattern).expect("failed creating pattern 1"); - // Matches lines containing significant comments or whitespace. - let line_regex = regex::Regex::new(r"(^\s*$)|(^\s*//\s*rustfmt-[^:]+:\s*\S+)") - .expect("failed creating pattern 2"); - reader .lines() .map(|line| line.expect("failed getting line")) - .filter(|line| line_regex.is_match(line)) + .filter(|l| l.trim_start().starts_with("//@")) .filter_map(|line| { - regex.captures_iter(&line).next().map(|capture| { - ( - capture - .get(1) - .expect("couldn't unwrap capture") - .as_str() - .to_owned(), - capture - .get(2) - .expect("couldn't unwrap capture") - .as_str() - .to_owned(), - ) - }) + match regex.captures(&line) { + Some(c) => Some((c["name"].to_owned(), c["value"].to_owned())), + None => panic!( + "{} has a malformed config directive. Should be //@ rustfmt-{}: {}", + &file_name.display(), + "{name}", + "{value}", + ), + } }) .collect() } From 8be56b1c4c5b76ebb99c539c264ff0b7ac9a6b06 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Wed, 7 Oct 2026 00:14:59 -0400 Subject: [PATCH 3/5] test: Add more validation for `//@ rustfmt-` test directives test authors will now get feedback when test directive: 1. are malformed 2. use invalid config option names 3. use invalid config values 4. somehow don't set configs --- src/config/config_type.rs | 12 ++++++++ src/test/mod.rs | 59 +++++++++++++++++++++++++++++---------- src/test/mod_resolver.rs | 2 +- src/test/parser.rs | 2 +- 4 files changed, 59 insertions(+), 16 deletions(-) diff --git a/src/config/config_type.rs b/src/config/config_type.rs index 6611a387814..ee1ccdb4378 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -244,6 +244,18 @@ macro_rules! create_config { CliConfigWasSet(self) } + #[allow(unreachable_pub)] + pub fn was_option_set(&self, key: &str) -> bool { + match key { + $( + stringify!($i) => { + ConfigWasSet(self).$i() + } + )+ + _ => false + } + } + fn fill_from_parsed_config(mut self, parsed: PartialConfig, dir: &Path) -> Config { $( if let Some(option_value) = parsed.$i { diff --git a/src/test/mod.rs b/src/test/mod.rs index 8ed88d3bf23..28c9c6437c3 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -258,7 +258,7 @@ fn warning_tests() { let files = get_test_files(Path::new("tests/warning/source"), true); for file in &files { - let mut config = read_config(file); + let mut config = read_config(file).expect("config is valid"); config.set().error_on_line_overflow(true); config.set().error_on_unformatted(true); @@ -379,7 +379,7 @@ fn modified_test() { // Helper function for comparing the results of rustfmt // to a known output file generated by one of the write modes. fn assert_output(source: &Path, expected_filename: &Path) { - let config = read_config(source); + let config = read_config(source).expect("config is valid"); let (_, source_file, _) = format_file(source, config.clone()); // Populate output by writing to a vec. @@ -790,7 +790,8 @@ fn check_files(files: Vec, opt_config: &Option) -> (Vec String>( } } -fn read_config(filename: &Path) -> Config { - let sig_comments = read_significant_comments(filename); +fn read_config(filename: &Path) -> Result { + let sig_comments = read_significant_comments(filename)?; let (edition, style_edition, version) = get_editions_from_comments(&sig_comments); // Look for a config file. If there is a 'config' property in the significant comments, use // that. Otherwise, if there are no significant comments at all, look for a config file with @@ -880,11 +881,40 @@ fn read_config(filename: &Path) -> Config { for (key, val) in &sig_comments { if key != "target" && key != "config" && key != "unstable" && key != "stable" { + if !Config::is_valid_name(key) { + // Check that all config names are valid + return Err(format!( + "{} set unrecognized config option {:?}", + &filename.display(), + key + )); + } + + if !Config::is_valid_key_val(key, val) { + // Check that all config values are valid + return Err(format!( + "{} set unrecognized value {:?} for config option {:?}", + &filename.display(), + key, + val + )); + } + config.override_value(key, val); + + if !config.was_option_set(key) { + // Check that all config values were properly set + return Err(format!( + "{} didn't correctly set {}: {}", + &filename.display(), + key, + val + )); + } } } - config + Ok(config) } fn format_file>(filepath: P, config: Config) -> (bool, SourceFile, FormatReport) { @@ -923,13 +953,13 @@ fn idempotent_check( filename: &PathBuf, opt_config: &Option, ) -> Result { - let sig_comments = read_significant_comments(filename); + let sig_comments = read_significant_comments(filename).expect("valid significant comments"); let config = if let Some(ref config_file_path) = opt_config { let (edition, style_edition, version) = get_editions_from_comments(&sig_comments); Config::from_toml_path(config_file_path, edition, style_edition, version) .expect("`rustfmt.toml` not found") } else { - read_config(filename) + read_config(filename).expect("config is valid") }; let (parsing_errors, source_file, format_report) = format_file(filename, config); if parsing_errors { @@ -986,7 +1016,7 @@ fn get_config( } // Reads significant comments of the form: `//@ rustfmt-key: value` into a hash map. -fn read_significant_comments(file_name: &Path) -> HashMap { +fn read_significant_comments(file_name: &Path) -> Result, String> { let file = fs::File::open(file_name) .unwrap_or_else(|_| panic!("couldn't read file {}", file_name.display())); let reader = BufReader::new(file); @@ -999,15 +1029,16 @@ fn read_significant_comments(file_name: &Path) -> HashMap { .map(|line| line.expect("failed getting line")) .filter(|l| l.trim_start().starts_with("//@")) .filter_map(|line| { - match regex.captures(&line) { - Some(c) => Some((c["name"].to_owned(), c["value"].to_owned())), - None => panic!( + let value = match regex.captures(&line) { + Some(c) => Ok((c["name"].to_owned(), c["value"].to_owned())), + None => Err(format!( "{} has a malformed config directive. Should be //@ rustfmt-{}: {}", &file_name.display(), "{name}", "{value}", - ), - } + )), + }; + Some(value) }) .collect() } diff --git a/src/test/mod_resolver.rs b/src/test/mod_resolver.rs index aacb2acc684..e918641b149 100644 --- a/src/test/mod_resolver.rs +++ b/src/test/mod_resolver.rs @@ -7,7 +7,7 @@ use crate::{FileName, Input, Session}; fn verify_mod_resolution(input_file_name: &str, exp_misformatted_files: &[&str]) { let input_file = PathBuf::from(input_file_name); - let config = read_config(&input_file); + let config = read_config(&input_file).expect("config is valid"); let mut session = Session::::new(config, None); let report = session .format(Input::File(input_file_name.into())) diff --git a/src/test/parser.rs b/src/test/parser.rs index c8cd419a9c9..0c8d7114093 100644 --- a/src/test/parser.rs +++ b/src/test/parser.rs @@ -8,7 +8,7 @@ use crate::{ErrorKind, Input, Session}; /// Load the config, but hide expected parse errors fn read_config_hide_parse_errors(filename: &std::path::Path) -> crate::Config { - let mut config = read_config(&filename); + let mut config = read_config(&filename).expect("config is valid"); config.set().show_parse_errors(false); config } From 55f071fb01dcd0da74e0a61e931bb5c1a3fd9072 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Wed, 7 Oct 2026 00:23:22 -0400 Subject: [PATCH 4/5] test: fix test cases after adding test directive validation --- tests/source/comment5.rs | 16 ++++++++-------- tests/target/comment5.rs | 20 ++++++++++---------- tests/target/postfix-yield.rs | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/source/comment5.rs b/tests/source/comment5.rs index 754e36510e6..d36ea9b138b 100644 --- a/tests/source/comment5.rs +++ b/tests/source/comment5.rs @@ -1,14 +1,14 @@ //@ rustfmt-normalize_comments: true //@ rustfmt-wrap_comments: true -//@ special comment -//@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam -//@ -//@foo +//~ special comment +//~ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam +//~ +//~foo fn test() {} -//@@@ another special comment -//@@@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam -//@@@ -//@@@foo +//~~~ another special comment +//~~~ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam +//~~~ +//~~~foo fn bar() {} diff --git a/tests/target/comment5.rs b/tests/target/comment5.rs index fdf9c5bad9f..8db1356c3e2 100644 --- a/tests/target/comment5.rs +++ b/tests/target/comment5.rs @@ -1,16 +1,16 @@ //@ rustfmt-normalize_comments: true //@ rustfmt-wrap_comments: true -//@ special comment -//@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. -//@ Sed sit amet ipsum mauris. Maecenas congue ligula ac quam -//@ -//@ foo +//~ special comment +//~ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam lectus. +//~ Sed sit amet ipsum mauris. Maecenas congue ligula ac quam +//~ +//~ foo fn test() {} -//@@@ another special comment -//@@@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam -//@@@ lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam -//@@@ -//@@@ foo +//~~~ another special comment +//~~~ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adiam +//~~~ lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam +//~~~ +//~~~ foo fn bar() {} diff --git a/tests/target/postfix-yield.rs b/tests/target/postfix-yield.rs index 8ee34ec4312..aa6822d47ab 100644 --- a/tests/target/postfix-yield.rs +++ b/tests/target/postfix-yield.rs @@ -1,5 +1,5 @@ // This demonstrates a proposed alternate or additional option of having yield in postfix position. -//@ edition: 2024 +//@ rustfmt-edition: 2024 #![feature(gen_blocks, coroutines, coroutine_trait, yield_expr)] From 64dca2ffb7864e848ee0133297ad85d1a4950c14 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Wed, 7 Oct 2026 15:21:15 -0400 Subject: [PATCH 5/5] test: don't silently let old test directive syntax slip through Make using `// rustfmt-{name}: {value}` a hard error. Also informs users that they should be using `//@ rustfmt-{name}: {value}` instead. --- src/test/mod.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/test/mod.rs b/src/test/mod.rs index 28c9c6437c3..68b3deae665 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -1020,6 +1020,11 @@ fn read_significant_comments(file_name: &Path) -> Result let file = fs::File::open(file_name) .unwrap_or_else(|_| panic!("couldn't read file {}", file_name.display())); let reader = BufReader::new(file); + + // Matches `// rustfmt-{name}: {value}` + let old_pattern = r"^\s*//\s+rustfmt-(?P[A-Za-z_]+)\s?:\s*(?P\S+)$"; + let old_regex = regex::Regex::new(old_pattern).expect("failed creating old pattern"); + // Matches `//@ rustfmt-{name}: {value}` let pattern = r"^\s*//@\s+rustfmt-(?P[A-Za-z_]+)\s?:\s*(?P\S+)$"; let regex = regex::Regex::new(pattern).expect("failed creating pattern 1"); @@ -1027,8 +1032,24 @@ fn read_significant_comments(file_name: &Path) -> Result reader .lines() .map(|line| line.expect("failed getting line")) - .filter(|l| l.trim_start().starts_with("//@")) + .filter(|l| l.trim_start().starts_with("//")) .filter_map(|line| { + if let Some(c) = old_regex.captures(&line) { + // Don't let old syntax silently slip through. + // Guide test authors on how to fix issues with the old syntax. + return Some(Err(format!( + "{} uses old directive syntax. Should be //@ rustfmt-{}: {}", + &file_name.display(), + &c["name"], + &c["value"], + ))); + } + + if !line.trim_start().starts_with("//@") { + // This is just a normal comment line + return None; + } + let value = match regex.captures(&line) { Some(c) => Ok((c["name"].to_owned(), c["value"].to_owned())), None => Err(format!(