You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustfmt wraps comments too tightly on first trait bound #7148
Sometimes I have comments to put on bounds within a where clause. For example:
unsafeimpl<T>SyncforPinnedOnceLock<T>where// Shared access to the PinnedOnceLock<T> also allows for creating T on a thread that may be// different from the one that later destroys the PinnedOnceLock<T>. So T also needs to be Send.T:Send,// Shared access to the PinnedOnceLock<T> allows for shared access to T, so T needs to be Sync// in order for the PinnedOnceLock<T> to be Sync.T:Sync,{}
For some reason, in this syntactic position wrap_comments wants to make the first comment much shorter than the second, even though comment_width is set appropriately:
unsafeimpl<T>SyncforPinnedOnceLock<T>where// Shared access to the PinnedOnceLock<T> also allows for// creating T on a thread that may be different from// the one that later destroys the PinnedOnceLock<T>. So T// also needs to be Send.T:Send,// Shared access to the PinnedOnceLock<T> allows for shared access to T, so T needs to be Sync// in order for the PinnedOnceLock<T> to be Sync.T:Sync,{}
Activity
maxdexh commentedon Sep 28, 2026
jieyouxu commentedon Sep 28, 2026
fix(items): format comments after where using clause_shape budget
fix(items): format comments after where using clause_shape budget
fix(items): format comments after where using clause_shape budget
jacobsa commentedon Oct 2, 2026
Thanks very much!
fix(items): format comments after where using clause_shape budget