rust/src/test/ui/macros
Dylan DPC f986c7434a
Rollup merge of #94868 - dtolnay:noblock, r=Dylan-DPC
Format core and std macro rules, removing needless surrounding blocks

Many of the asserting and printing macros in `core` and `std` are written with prehistoric-looking formatting, like this:

335ffbfa54/library/std/src/macros.rs (L96-L101)

In modern Rust style this would conventionally be written as follows instead, always using braces and a trailing semicolon on the macro arms:

af53809c87/library/std/src/macros.rs (L98-L105)

Getting rid of the unneeded braces inside the expansion reduces extraneous indentation in macro-expanded code. For example:

```rust
println!("repro {}", true);
```

```rust
// before:

{
    ::std::io::_print(
        ::core::fmt::Arguments::new_v1(
            &["repro ", "\n"],
            &[::core::fmt::ArgumentV1::new_display(&true)],
        ),
    );
};
```

```rust
// after:

::std::io::_print(
    ::core::fmt::Arguments::new_v1(
        &["repro ", "\n"],
        &[::core::fmt::ArgumentV1::new_display(&true)],
    ),
);
```
2022-03-16 03:34:32 +01:00
..
auxiliary Permit #[deprecated] in stdlib 2022-03-09 16:32:47 -05:00
issue-69838-dir
macro-expanded-include Stabilize asm! and global_asm! 2021-12-12 11:20:03 +00:00
rfc-3086-metavar-expr Implement macro meta-variable expression 2022-03-11 17:48:51 -03:00
syntax-extension-source-utils-files
ambiguity-legacy-vs-modern.rs
ambiguity-legacy-vs-modern.stderr Edit error messages for rustc_resolve::AmbiguityKind variants 2021-10-25 20:33:07 -05:00
assert-as-macro.rs
assert-eq-macro-msg.rs
assert-eq-macro-panic.rs
assert-eq-macro-success.rs
assert-eq-macro-unsized.rs
assert-format-lazy.rs
assert-macro-explicit.rs
assert-macro-fmt.rs
assert-macro-owned.rs
assert-macro-static.rs
assert-matches-macro-msg.rs
assert-ne-macro-msg.rs
assert-ne-macro-panic.rs
assert-ne-macro-success.rs
assert-ne-macro-unsized.rs
assert-trailing-junk.rs
assert-trailing-junk.stderr Bless tests 2021-10-15 02:36:58 -05:00
assert.rs
assert.stderr Bless tests 2021-10-15 02:36:58 -05:00
attr-empty-expr.rs
attr-empty-expr.stderr
bad_hello.rs
bad_hello.stderr
bad-concat.rs
bad-concat.stderr
bang-after-name.fixed Give better error for macro_rules! name! 2021-09-24 16:21:34 +01:00
bang-after-name.rs Give better error for macro_rules! name! 2021-09-24 16:21:34 +01:00
bang-after-name.stderr Give better error for macro_rules! name! 2021-09-24 16:21:34 +01:00
builtin-prelude-no-accidents.rs
builtin-prelude-no-accidents.stderr
builtin-std-paths-fail.rs
builtin-std-paths-fail.stderr
builtin-std-paths.rs
cfg.rs
cfg.stderr Bless tests 2021-10-15 02:36:58 -05:00
colorful-write-macros.rs
concat-bytes-error.rs Clarify that repeat count must be positive 2021-12-27 12:31:40 -05:00
concat-bytes-error.stderr Clarify that repeat count must be positive 2021-12-27 12:31:40 -05:00
concat-bytes.rs Support [x; n] expressions in concat_bytes! 2021-12-18 08:50:01 -05:00
concat-rpass.rs
concat.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
concat.stderr Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
conditional-debug-macro-on.rs
cross-crate-pat-span.rs
derive-in-eager-expansion-hang.rs
derive-in-eager-expansion-hang.stderr
die-macro-2.rs
die-macro-expr.rs
die-macro-pure.rs
die-macro.rs
doc-comment.rs
dollar-crate-nested-encoding.rs
duplicate-builtin.rs
duplicate-builtin.stderr
edition-macro-pats.rs
empty-trailing-stmt.rs
empty-trailing-stmt.stderr
format-foreign.rs
format-foreign.stderr
format-parse-errors.rs
format-parse-errors.stderr Bless tests 2021-10-15 02:36:58 -05:00
format-unused-lables.rs
format-unused-lables.stderr
global-asm.rs Stabilize asm! and global_asm! 2021-12-12 11:20:03 +00:00
global-asm.stderr Bless tests 2021-10-15 02:36:58 -05:00
html-literals.rs
include-single-expr-helper-1.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
include-single-expr-helper.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
include-single-expr.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
include-single-expr.stderr Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
issue-5060.rs
issue-6596-1.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-6596-1.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-8709.rs
issue-16098.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-16098.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-19163.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-19163.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-21356.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-21356.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-22463.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-25274.rs
issue-26322.rs
issue-29084.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-29084.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-30143.rs
issue-30143.stderr
issue-34171.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-34421-mac-expr-bad-stmt-good-add-semi.rs
issue-34421-mac-expr-bad-stmt-good-add-semi.stderr
issue-37175.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-39388.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-39388.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-39404.rs
issue-39404.stderr
issue-40469.rs
issue-40770.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-41803.rs
issue-52169.rs
issue-54441.rs
issue-54441.stderr Bless tests 2021-10-15 02:36:58 -05:00
issue-57597.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-57597.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-58490.rs
issue-58490.stderr
issue-61033-1.rs
issue-61033-1.stderr
issue-61033-2.rs
issue-61033-2.stderr
issue-61053-different-kleene.rs
issue-61053-different-kleene.stderr
issue-61053-duplicate-binder.rs
issue-61053-duplicate-binder.stderr
issue-61053-missing-repetition.rs
issue-61053-missing-repetition.stderr
issue-61053-unbound.rs
issue-61053-unbound.stderr
issue-63102.rs
issue-68058.rs
issue-68060.rs
issue-68060.stderr
issue-69838-mods-relative-to-included-path.rs
issue-70446.rs
issue-75982-foreign-macro-weird-mod.rs
issue-77475.rs
issue-78325-inconsistent-resolution.rs
issue-78325-inconsistent-resolution.stderr Bless tests 2021-10-15 02:36:58 -05:00
issue-78333.rs
issue-78892-substitution-in-statement-attr.rs
issue-81006.rs
issue-81006.stderr
issue-83340.rs
issue-83340.stderr
issue-83344.rs
issue-83344.stderr
issue-84195-lint-anon-const.rs
issue-84195-lint-anon-const.stderr
issue-84429-matches-edition.rs
issue-84632-eager-expansion-recursion-limit.rs Improve help for recursion limit errors 2021-09-28 22:17:13 +02:00
issue-84632-eager-expansion-recursion-limit.stderr Bless tests 2021-10-15 02:36:58 -05:00
issue-86082-option-env-invalid-char.rs
issue-86865.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-86865.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
issue-87877.rs expand: Treat more macro calls as statement macro calls 2021-09-02 14:14:38 +03:00
issue-88206.rs Improve wording of macro-not-found-but-name-exists note. 2021-08-23 16:57:59 +02:00
issue-88206.stderr Improve wording of macro-not-found-but-name-exists note. 2021-08-23 16:57:59 +02:00
issue-88228.rs Update tests. 2021-08-23 16:43:54 +02:00
issue-88228.stderr Update tests. 2021-08-23 16:43:54 +02:00
issue-92267.rs [rustc_builtin_macros] add indices to format_foreign::printf::Substitution::Escape 2021-12-31 12:42:15 -05:00
issue-92267.stderr [rustc_builtin_macros] add indices to format_foreign::printf::Substitution::Escape 2021-12-31 12:42:15 -05:00
lint-trailing-macro-call.rs Fix linting when trailing macro expands to a trailing semi 2021-09-15 19:36:28 -05:00
lint-trailing-macro-call.stderr Fix linting when trailing macro expands to a trailing semi 2021-09-15 19:36:28 -05:00
local-ambiguity-multiple-parsing-options.rs
local-ambiguity-multiple-parsing-options.stderr
log_syntax-trace_macros-macro-locations.rs
log_syntax-trace_macros-macro-locations.stdout
macro_path_as_generic_bound.rs
macro_path_as_generic_bound.stderr
macro_undefined.rs
macro_undefined.stderr
macro_with_super_2.rs
macro-2.rs
macro-as-fn-body.rs
macro-at-most-once-rep-2015-rpass.rs
macro-at-most-once-rep-2015.rs
macro-at-most-once-rep-2015.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-at-most-once-rep-2018-rpass.rs
macro-at-most-once-rep-2018.rs
macro-at-most-once-rep-2018.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-attribute-expansion.rs
macro-attribute.rs
macro-attribute.stderr
macro-attributes.rs
macro-backtrace-invalid-internals.rs
macro-backtrace-invalid-internals.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-backtrace-nested.rs
macro-backtrace-nested.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-backtrace-println.rs
macro-backtrace-println.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-block-nonterminal.rs
macro-comma-behavior-rpass.rs Add needs-unwind to tests that depend on panicking 2021-12-09 22:03:52 +00:00
macro-comma-behavior.core.stderr
macro-comma-behavior.rs
macro-comma-behavior.std.stderr
macro-comma-support-rpass.rs
macro-comma-support.rs
macro-comma-support.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-context.rs
macro-context.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-crate-def-only.rs
macro-crate-nonterminal-non-root.rs
macro-crate-nonterminal-non-root.stderr
macro-crate-nonterminal-renamed.rs
macro-crate-nonterminal.rs
macro-crate-use.rs
macro-deep_expansion.rs
macro-def-site-super.rs resolve: Cache module loading for all foreign modules 2021-10-02 18:31:42 +03:00
macro-delimiter-significance.rs
macro-deprecation.rs
macro-deprecation.stderr
macro-doc-comments.rs
macro-doc-escapes.rs
macro-doc-raw-str-hashes.rs
macro-error.rs
macro-error.stderr
macro-expansion-tests.rs
macro-expansion-tests.stderr
macro-export-inner-module.rs
macro-first-set.rs
macro-follow-rpass.rs
macro-follow.rs
macro-follow.stderr
macro-followed-by-seq-bad.rs
macro-followed-by-seq-bad.stderr
macro-followed-by-seq.rs
macro-in-expression-context-2.rs
macro-in-expression-context-2.stderr
macro-in-expression-context.fixed
macro-in-expression-context.rs
macro-in-expression-context.stderr
macro-in-fn.rs
macro-include-items.rs
macro-inner-attributes.rs
macro-inner-attributes.stderr suggestion for typoed crate or module 2021-10-13 12:17:02 +09:00
macro-input-future-proofing.rs
macro-input-future-proofing.stderr
macro-interpolation.rs Add test of NtTy in a qpath 2021-11-25 15:03:59 -08:00
macro-invalid-fragment-spec.rs
macro-invalid-fragment-spec.stderr
macro-invocation-in-count-expr-fixed-array-type.rs
macro-lifetime-used-with-bound.rs
macro-lifetime-used-with-labels.rs
macro-lifetime-used-with-labels.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-lifetime-used-with-static.rs
macro-lifetime.rs
macro-literal.rs
macro-local-data-key-priv.rs
macro-local-data-key-priv.stderr Bless tests 2021-10-15 02:36:58 -05:00
macro-match-nonterminal.rs
macro-match-nonterminal.stderr
macro-meta-items-modern.rs
macro-meta-items.rs
macro-method-issue-4621.rs
macro-missing-delimiters.rs
macro-missing-delimiters.stderr
macro-missing-fragment.rs
macro-missing-fragment.stderr
macro-multiple-items.rs
macro-multiple-matcher-bindings.rs
macro-multiple-matcher-bindings.stderr
macro-name-typo.rs
macro-name-typo.stderr
macro-named-default.rs
macro-nested_definition_issue-31946.rs
macro-nested_expr.rs
macro-nested_stmt_macros.rs
macro-non-lifetime.rs Cleanup feature gates. 2022-03-03 18:50:28 +01:00
macro-non-lifetime.stderr Cleanup feature gates. 2022-03-03 18:50:28 +01:00
macro-nt-list.rs
macro-of-higher-order.rs
macro-or-patterns-back-compat.fixed
macro-or-patterns-back-compat.rs
macro-or-patterns-back-compat.stderr
macro-outer-attributes.rs
macro-outer-attributes.stderr
macro-parameter-span.rs
macro-parameter-span.stderr
macro-pat2021-pattern-followed-by-or.rs
macro-pat2021-pattern-followed-by-or.stderr Bless duplicate test 2021-11-29 22:38:26 -08:00
macro-pat-follow-2018.rs
macro-pat-follow.rs
macro-pat-neg-lit.rs
macro-pat-pattern-followed-by-or-in-2021.rs
macro-pat-pattern-followed-by-or-in-2021.stderr Bless tests with new suggestion 2021-11-29 22:20:34 -08:00
macro-pat-pattern-followed-by-or.rs
macro-pat.rs
macro-path-prelude-fail-1.rs Cleanup feature gates. 2022-03-03 18:50:28 +01:00
macro-path-prelude-fail-1.stderr Cleanup feature gates. 2022-03-03 18:50:28 +01:00
macro-path-prelude-fail-2.rs
macro-path-prelude-fail-2.stderr
macro-path-prelude-fail-3.rs
macro-path-prelude-fail-3.stderr Clarify what attribute and derive macros look like. 2021-08-23 16:57:58 +02:00
macro-path-prelude-fail-4.rs
macro-path-prelude-fail-4.stderr
macro-path-prelude-pass.rs
macro-path-prelude-shadowing.rs Cleanup feature gates. 2022-03-03 18:50:28 +01:00
macro-path-prelude-shadowing.stderr Edit error messages for rustc_resolve::AmbiguityKind variants 2021-10-25 20:33:07 -05:00
macro-path.rs
macro-pub-matcher.rs
macro-reexport-removed.rs
macro-reexport-removed.stderr
macro-seq-followed-by-seq.rs
macro-shadowing-relaxed.rs
macro-shadowing.rs
macro-shadowing.stderr Edit error messages for rustc_resolve::AmbiguityKind variants 2021-10-25 20:33:07 -05:00
macro-stability-rpass.rs Update tests 2021-08-28 00:24:39 -07:00
macro-stability.rs Permit #[deprecated] in stdlib 2022-03-09 16:32:47 -05:00
macro-stability.stderr Change rustc_deprecated to use note 2022-03-04 18:15:49 -05:00
macro-stmt_macro_in_expr_macro.rs
macro-stmt-matchers.rs
macro-stmt.rs
macro-tt-followed-by-seq.rs
macro-tt-matchers.rs
macro-use-all-and-none.rs
macro-use-all-and-none.stderr Check for duplicate attributes. 2021-11-18 16:10:26 -08:00
macro-use-all.rs
macro-use-bad-args-1.rs
macro-use-bad-args-1.stderr
macro-use-bad-args-2.rs
macro-use-bad-args-2.stderr
macro-use-both.rs
macro-use-one.rs
macro-use-scope.rs
macro-use-undef.rs
macro-use-undef.stderr
macro-use-wrong-name.rs
macro-use-wrong-name.stderr
macro-with-attrs1.rs
macro-with-attrs2.rs
macro-with-braces-in-expr-position.rs
macros-in-extern.rs
macros-nonfatal-errors.rs Remove ui tests for LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
macros-nonfatal-errors.stderr Remove ui tests for LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
malformed_macro_lhs.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
malformed_macro_lhs.stderr Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
meta-item-absolute-path.rs
meta-item-absolute-path.stderr
meta-variable-misuse.rs
missing-bang-in-decl.fixed Give better error for macro_rules name 2021-10-01 22:47:39 +01:00
missing-bang-in-decl.rs Give better error for macro_rules name 2021-10-01 22:47:39 +01:00
missing-bang-in-decl.stderr Give better error for macro_rules name 2021-10-01 22:47:39 +01:00
missing-comma.rs
missing-comma.stderr
must-use-in-macro-55516.rs
must-use-in-macro-55516.stderr Bless tests 2021-10-15 02:36:58 -05:00
no-std-macros.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
none-delim-lookahead.rs
nonterminal-matching.rs Pretty print empty blocks as {} 2021-12-01 13:50:13 -08:00
nonterminal-matching.stderr Pretty print empty blocks as {} 2021-12-01 13:50:13 -08:00
not-utf8.bin
not-utf8.rs
not-utf8.stderr
out-of-order-shadowing.rs Move some tests to more reasonable directories 2021-09-15 14:03:27 -03:00
out-of-order-shadowing.stderr Edit error messages for rustc_resolve::AmbiguityKind variants 2021-10-25 20:33:07 -05:00
parse-complex-macro-invoc-op.rs
paths-in-macro-invocations.rs
proc_macro.rs Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
pub-item-inside-macro.rs
pub-method-inside-macro.rs
restricted-shadowing-legacy.rs
restricted-shadowing-legacy.stderr Edit error messages for rustc_resolve::AmbiguityKind variants 2021-10-25 20:33:07 -05:00
restricted-shadowing-modern.rs
restricted-shadowing-modern.stderr Edit error messages for rustc_resolve::AmbiguityKind variants 2021-10-25 20:33:07 -05:00
same-sequence-span.rs
same-sequence-span.stderr Bless tests 2021-10-15 02:36:58 -05:00
semi-after-macro-ty.rs
span-covering-argument-1.rs
span-covering-argument-1.stderr Bless tests 2021-10-15 02:36:58 -05:00
stmt_expr_attr_macro_parse.rs
stringify.rs Bless all pretty printer tests and ui tests 2022-02-03 10:59:36 -08:00
syntax-extension-cfg.rs
syntax-extension-source-utils.rs
trace_faulty_macros.rs
trace_faulty_macros.stderr Bless tests 2021-10-15 02:36:58 -05:00
trace_macros-format.rs Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
trace_macros-format.stderr Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
trace-macro.rs
trace-macro.stderr Format core and std macro rules, removing needless surrounding blocks 2022-03-11 15:26:51 -08:00
try-macro.rs
two-macro-use.rs
type-macros-hlist.rs
type-macros-simple.rs
typeck-macro-interaction-issue-8852.rs
unimplemented-macro-panic.rs
unknown-builtin.rs
unknown-builtin.stderr
unreachable-arg.edition_2021.stderr Take in account the unreachable! macro in the non_fmt_panic lint 2022-01-31 17:09:31 +01:00
unreachable-arg.rs Take in account the unreachable! macro in the non_fmt_panic lint 2022-01-31 17:09:31 +01:00
unreachable-fmt-msg.rs
unreachable-format-arg.rs Take in account the unreachable! macro in the non_fmt_panic lint 2022-01-31 17:09:31 +01:00
unreachable-format-args.edition_2015.stderr Fix invalid special casing of the unreachable! macro 2022-01-31 17:09:31 +01:00
unreachable-format-args.rs Fix invalid special casing of the unreachable! macro 2022-01-31 17:09:31 +01:00
unreachable-macro-panic.rs
unreachable-static-msg.rs
unreachable.rs
use-macro-self.rs
vec-macro-in-pattern.rs
vec-macro-in-pattern.stderr