-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: wrap_comments with a markdown list #3224
Comments
Do you have some options set in your |
Yes. wrap_comments = true is probably the only relevant one. I can reproduce the issue with just these two files:
wrap_comments = true # Commenting this solves the issue
//! * [`examples/simple`] – Demonstrates use of the [`init`] API with plain
//! structs.
//! * [`examples/simple_flatbuffer`] – Demonstrates use of the [`init`] API with
//! FlatBuffers.
//! * [`examples/gravity`] – Demonstrates use of the [`RLBot::set_game_state`]
//! API And here's my version which should have gone in the top post. I think I did all the right steps to update fully, but I'm sitting at ~2 weeks ago: $ rustup update nightly
nightly-x86_64-pc-windows-msvc updated - rustc 1.32.0-nightly (d09466ceb 2018-11-30)
$ rustup component add rustfmt-preview --toolchain nightly
info: component 'rustfmt-preview' for target 'x86_64-pc-windows-msvc' is up to date
$ rustup run nightly rustfmt --version
rustfmt 1.0.0-nightly (1cc61cfc 2018-11-19) |
@whatisaphone thanks for the extra information. I wrote that comment while asleep because I didn't try the obvious option! If you want there's an open PR with a fix you can try out. With your example, something funny came out: the dash in the @nrc this difference in bytes length had a negative impact in the I'm wondering if we should use graphemes throughout the project, in order to avoid problems like above ? That way each rewrite operation would be more "realistic". |
Sorry for waking you up! :) Yep, it's an en-dash – gotta keep the docs pretty. I tested your PR and it works, thanks for the fix! I think I'm with you on graphemes. As an lowly user, my expectation is that the characters wrap based on whatever my editor displays. I just tried a few editors and they all display both these lines identically: fn main() {
println!("{}", "é".len());
println!("{}", "é".len());
} (although it breaks editing on play.rust-lang.org, that was an interesting bug) |
@whatisaphone I don't know what's that character but it's messing my editor too! |
We absolutely should! We tried to move off bytes years ago and anywhere they're are left is a bug (though there are rather a lot of such places). |
I have this list in a module doc comment:
Recently, this diff appeared in CI:
For some reason rustfmt decided that the middle item, and only the middle item, should not indent past the bullet point.
Unfortunately I don't work on this crate too often so I don't have a good idea of when it regressed. The last successful build used the nightly from Nov 3. The failure used today's nightly.
The text was updated successfully, but these errors were encountered: