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
@scampi & @topecongiro - correct me if I'm wrong but my understanding is that the current focus is on rustfmt 2.0, and that stabilization of some of these currently-unstable config options won't come til after the 2.0 release (based on https://github.com/rust-lang/rustfmt/projects/2)
FWIW while I'd like to see this stabilized, this option can also break markdown. Last time I tried, a large markdown table I had was wrapped, which meant it was no longer valid markdown.
Reacted by James Martindale, Max, Amelia Clarke, Jacob Birkett and Bryan Hitchcock
Is there a way of saying "Do not wrap this comment"? We have a similar problem with long maths formulae. It's not a blocker, it just takes a bit of effort to fix up the formulae afterwards, however it would be nice if we could make exceptions for some blocks of text. I suppose the markdown could be checked programatically before and after each conversion and the formatting could be skipped if the markdown is broken. That won't catch the formulae but it might help in your case @jhpratt . Maybe there is a nice markdown formatter out there in the wild that understands when it is looking at a table.
Would it be plausible to split this into wrap_comments and wrap_doc_comments, and make wrap_doc_comments markdown aware?
Could you elaborate a bit on the motivation? Is it just about wanting wrap_comments stabilized more quickly or are there cases where you'd want to wrap doc comments but not other comments or vice versa?
I actually don't care about normal comments much, I want to be able to have rustfmt wrap my doc comments. My thought was that normal comments aren't required to be markdown, so it would make sense to split the implementation.
Reacted by Luna Razzaghipour, Amelia Clarke and Frank Steffahn
Activity
[-][unstable option] unstable option: wrap_comments[/-][+][unstable option] wrap_comments[/+]carllerche commentedon May 10, 2019
What is left to stabilize this?
scampi commentedon May 16, 2019
There is now a documented process describing stabilisation so we'd have to go through the conditions set there.
benbrittain commentedon Oct 28, 2019
Is there a link to the stabilization process? I can't find it from the README.
I'd like to see us go through this process for the
wrap_commentsfeaturecalebcartwright commentedon Oct 28, 2019
The process for stabilizing options is defined in https://github.com/rust-lang/rustfmt/blob/master/Processes.md
@scampi & @topecongiro - correct me if I'm wrong but my understanding is that the current focus is on rustfmt 2.0, and that stabilization of some of these currently-unstable config options won't come til after the 2.0 release (based on https://github.com/rust-lang/rustfmt/projects/2)
jhpratt commentedon Oct 31, 2020
FWIW while I'd like to see this stabilized, this option can also break markdown. Last time I tried, a large markdown table I had was wrapped, which meant it was no longer valid markdown.
bitdivine commentedon Nov 9, 2020
Is there a way of saying "Do not wrap this comment"? We have a similar problem with long maths formulae. It's not a blocker, it just takes a bit of effort to fix up the formulae afterwards, however it would be nice if we could make exceptions for some blocks of text. I suppose the markdown could be checked programatically before and after each conversion and the formatting could be skipped if the markdown is broken. That won't catch the formulae but it might help in your case @jhpratt . Maybe there is a nice markdown formatter out there in the wild that understands when it is looking at a table.
daniel5151 commentedon Dec 7, 2020
Any updates on this?
jhpratt commentedon Dec 7, 2020
@daniel5151 Updates are posted as they come in. What you see in this thread is the current status.
Nemo157 commentedon Dec 16, 2020
Would it be plausible to split this into
wrap_commentsandwrap_doc_comments, and makewrap_doc_commentsmarkdown aware?calebcartwright commentedon Dec 17, 2020
Could you elaborate a bit on the motivation? Is it just about wanting
wrap_commentsstabilized more quickly or are there cases where you'd want to wrap doc comments but not other comments or vice versa?Nemo157 commentedon Dec 17, 2020
I actually don't care about normal comments much, I want to be able to have rustfmt wrap my doc comments. My thought was that normal comments aren't required to be markdown, so it would make sense to split the implementation.
jhpratt commentedon Dec 21, 2020
calebcartwright commentedon Dec 21, 2020
24 remaining items
honestlysamuk commentedon Jul 10, 2026
I found a bug using this feature flag where it involved comment blocks. There were occasions where I had something like
which then transformed to
I think that this is the markdown aware part of the doc comment above. Clippy then lints our docs and warns on this.
wrap_commentscan break up code snippets #5250wrap_comments(merges short lines in lists) #5836wrap_comments=true#5862usedeclarations are limited to 5 characters less thanmax_width#5914wrap_commentssplits inside a link destination containing@or/, breaking the link #7177JanDiederich commentedon Oct 24, 2026
ytmimi commentedon Oct 24, 2026