fix: Improve prettify_macro_expansion()#22058
fix: Improve prettify_macro_expansion()#22058A4-Tacks wants to merge 3 commits intorust-lang:masterfrom
Conversation
4284af4 to
0720578
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
0720578 to
e3cb51a
Compare
- Add basic tests for prettify_macro_expansion
Example
---
```rust
const _: () = {
loop {break}
foo()
};
```
**Before this PR**
```rust
const _:() = {
loop{
break
}foo()
};
```
**After this PR**
```rust
const _: () = {
loop {
break
}
foo()
};
```
---
```rust
const _: () = {
match 2 {
tmp => foo!(),
};
};
```
**Before this PR**
```rust
const _:() = {
match 2 {
tmp => foo!(),
};
};
```
**After this PR**
```rust
const _: () = {
match 2 {
tmp => foo!(),
};
};
```
e3cb51a to
398a9f8
Compare
|
Is there a real reason to improve this function? Where important, we pass its output to rustfmt. We only need it so that tokens won't be combined. |
Yes, when I use |
|
Then we just should pass it to rustfmt there too. |
|
No, most of the time I use |
Example
Before this PR
After this PR
Before this PR
After this PR