Skip to content

fix: don't leave trailing whitespace before a skipped impl item - #6979

Open
shulaoda wants to merge 1 commit into
rust-lang:mainfrom
shulaoda:07-26-fix_don_t_leave_trailing_whitespace_before_a_skipped_impl_item
Open

fix: don't leave trailing whitespace before a skipped impl item#6979
shulaoda wants to merge 1 commit into
rust-lang:mainfrom
shulaoda:07-26-fix_don_t_leave_trailing_whitespace_before_a_skipped_impl_item

Conversation

@shulaoda

@shulaodashulaoda commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes#5521

Review notes

Whitespace characters on the blank line before the skipped item:

writtenbeforeafter
100
220
320
440
11100
12120

The skipped item has to be a non-first item of an impl block. The same whitespace in a mod, in a function body, at the top level, or before the first impl item is trimmed elsewhere and was never affected, so the test uses that one shape for all four cases.

#4706 was raised on the issue as a possible duplicate. There the whitespace is inside the body of the skipped item, which the attribute asks rustfmt to leave alone. Here it sits between the previous item and the attribute, outside any skipped span.

@rustbotrustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Jul 25, 2026
@shulaoda
shulaodaforce-pushed the 07-26-fix_don_t_leave_trailing_whitespace_before_a_skipped_impl_item branch from 9754d09 to 1bf1d81CompareAugust 1, 2026 20:41
@rustbot

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

@jieyouxujieyouxu self-assigned this Aug 11, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-reviewStatus: awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error[internal]: left behind trailing whitespace

3 participants

@shulaoda@rustbot@jieyouxu