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

@shulaoda shulaoda commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #5521

Review notes

Whitespace characters on the blank line before the skipped item:

written before after
1 0 0
2 2 0
3 2 0
4 4 0
11 10 0
12 12 0

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.

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

rustbot commented Aug 1, 2026

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.

@jieyouxu jieyouxu self-assigned this Aug 11, 2026
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.

error[internal]: left behind trailing whitespace

3 participants