Repository navigation
Don't lose comments and attributes between cfg_select! predicates, outer/inner blocks, arm body and trailing commas - #7211
Conversation
I.e. do not try to use `{{ ... }}` concise double-block formatting if
there are comments in-between the outer/inner braces.
|
(First 2 are test logistics, it was annoying me that I couldn't find |
|
It feels like we implemented things pretty similarly in regards to what this PR now calls I'd be happy to merge this on the rustfmt side, but I still think we should try to move forward with rust-lang/rust#164815 to provide an immediate fix for nightly in the most common case of a comment being written between the start of the outer block and the inner block. This PR is more comprehensive with the edge cases that it covers so I'd also be in favor of syncing this up to r-l/r sometime next week if this merges. |
Sent the r-l/r side to the queue. I think we can merge this PR on rustfmt side as well, we'll sort out the merge conflicts on subtree sync. |
Didn't realize Yacin was already working on a patch for #7209 :D Anyway, we can compare notes since there's several annoying edge cases. Probably yoink changes out from this PR if you want.
Best reviewed commit-by-commit. See individual commits.
r? @ytmimi
Used LLM for adversarial review, not changes.