rust/tests
bors 8cc6f34653 Auto merge of #119427 - dtolnay:maccall, r=compiler-errors
Fix, document, and test parser and pretty-printer edge cases related to braced macro calls

_Review note: this is a deceptively small PR because it comes with 145 lines of docs and 196 lines of tests, and only 25 lines of compiler code changed. However, I recommend reviewing it 1 commit at a time because much of the effect of the code changes is non-local i.e. affecting code that is not visible in the final state of the PR. I have paid attention that reviewing the PR one commit at a time is as easy as I can make it. All of the code you need to know about is touched in those commits, even if some of those changes disappear by the end of the stack._

This is a follow-up to https://github.com/rust-lang/rust/pull/119105. One case that is not relevant to `-Zunpretty=expanded`, but which came up as I'm porting #119105 and #118726 into `syn`'s printer and `prettyplease`'s printer where it **is** relevant, and is also relevant to rustc's `stringify!`, is statement boundaries in the vicinity of braced macro calls.

Rustc's AST pretty-printer produces invalid syntax for statements that begin with a braced macro call:

```rust
macro_rules! stringify_item {
    ($i:item) => {
        stringify!($i)
    };
}

macro_rules! repro {
    ($e:expr) => {
        stringify_item!(fn main() { $e + 1; })
    };
}

fn main() {
    println!("{}", repro!(m! {}));
}
```

**Before this PR:** output is not valid Rust syntax.

```console
fn main() { m! {} + 1; }
```

```console
error: leading `+` is not supported
 --> <anon>:1:19
  |
1 | fn main() { m! {} + 1; }
  |                   ^ unexpected `+`
  |
help: try removing the `+`
  |
1 - fn main() { m! {} + 1; }
1 + fn main() { m! {}  1; }
  |
```

**After this PR:** valid syntax.

```console
fn main() { (m! {}) + 1; }
```
2024-05-12 04:18:20 +00:00
..
assembly Add inline comments why we're forcing the target cpu 2024-05-01 16:54:20 -07:00
auxiliary Clean up users of rust_dbg_call 2024-04-17 15:08:08 -04:00
codegen fix few typo in filecheck annotations 2024-05-11 13:10:24 +03:00
codegen-units Codegen const panic messages as function calls 2024-03-22 09:55:50 -04:00
coverage Auto merge of #124223 - Zalathar:conditional-let, r=compiler-errors 2024-05-07 22:28:51 +00:00
coverage-run-rustdoc
crashes ignore generics args in attribute paths 2024-05-11 00:13:27 +08:00
debuginfo Implement lldb formattter for "clang encoded" enums (LLDB 18.1+) 2024-05-05 17:53:02 -07:00
incremental add test for incremental ICE: slice-pattern-const.rs #83085 2024-04-21 14:45:00 +02:00
mir-opt Auto merge of #124795 - scottmcm:simplify-slice-from-raw-parts, r=joboet 2024-05-08 19:37:57 +00:00
pretty Rollup merge of #124269 - scrabsha:sasha/fix-124206, r=dtolnay 2024-04-29 18:03:22 +01:00
run-make Migrate run-make/rustdoc-shared-flags to rmake 2024-05-11 12:39:22 +02:00
run-make-fulldeps Soft-destabilize RustcEncodable/RustcDecodable 2024-03-22 13:24:35 -07:00
run-pass-valgrind
rustdoc Always hide private fields in aliased type 2024-05-11 13:11:46 +02:00
rustdoc-gui Rollup merge of #124738 - notriddle:notriddle/search-form-js, r=GuillaumeGomez 2024-05-07 18:12:54 +02:00
rustdoc-js rustdoc-search: add parser for & syntax 2024-04-19 14:31:21 -07:00
rustdoc-js-std rustdoc-search: add parser for & syntax 2024-04-19 14:31:21 -07:00
rustdoc-json
rustdoc-ui Always hide private fields in aliased type 2024-05-11 13:11:46 +02:00
ui Auto merge of #119427 - dtolnay:maccall, r=compiler-errors 2024-05-12 04:18:20 +00:00
ui-fulldeps Add ErrorGuaranteed to Recovered::Yes and use it more. 2024-05-09 20:12:07 +10:00
COMPILER_TESTS.md