Skip to content

fix: add whitespace in macro for delegate assists#22330

Open
A4-Tacks wants to merge 4 commits into
rust-lang:masterfrom
A4-Tacks:pretty-delegate-in-macro
Open

fix: add whitespace in macro for delegate assists#22330
A4-Tacks wants to merge 4 commits into
rust-lang:masterfrom
A4-Tacks:pretty-delegate-in-macro

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

  • Move pretty_pat_in_macro to utils
  • Insert ws out of node for prettify_macro_expansion
  • Pretty in macro for generate_delegate_methods
  • Pretty in macro for generate_delegate_trait

Before:

pub fn test(self,b: &mutbar::Bar) ->bar::Bar {
    self.bar.test(b)
}

After:

pub fn test(self,b: &mut bar::Bar) -> bar::Bar {
    self.bar.test(b)
}

A4-Tacks added 3 commits May 10, 2026 06:54
**Before**

```text
VISIBILITY@0..4
  PUB_KW@0..3 "pub"
  WHITESPACE@3..4 " "
FN_KW@4..6 "fn"
WHITESPACE@6..7 " "
...
```

**After**

```rust
VISIBILITY@0..3
  PUB_KW@0..3 "pub"
WHITESPACE@3..4 " "
FN_KW@4..6 "fn"
...
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2026
@A4-Tacks A4-Tacks force-pushed the pretty-delegate-in-macro branch from 9f711da to 6eaba64 Compare May 10, 2026 03:19
@A4-Tacks A4-Tacks force-pushed the pretty-delegate-in-macro branch from 6eaba64 to 356e906 Compare May 10, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants