-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix long lines which rustfmt fails to format #136606
Conversation
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
This PR modifies If appropriate, please update |
rustfmt fails to format this match expression, because it has several long string literals over the maximum line width. This seems to exhibit rustfmt issues rust-lang#3863 (Gives up on chains if any line is too long) and rust-lang#3156 (Fail to format match arm when other arm has long line).
24f7868
to
593c88f
Compare
This PR modifies If appropriate, please update |
Also, the periods and possibly the sentence capitalization seem to go against the style for Rust error messages. But, since they're sourced from the UEFI Specification, I left them be. I'm not sure whether they should be changed. |
Looks great now, thanks. @bors r+ rollup |
…braheemdev Fix long lines which rustfmt fails to format rustfmt fails to format this match expression, because it has several long string literals over the maximum line width. This seems to exhibit rustfmt issues [rust-lang#3863](rust-lang/rustfmt#3863) (Gives up on chains if any line is too long) and [rust-lang#3156](rust-lang/rustfmt#3156) (Fail to format match arm when other arm has long line). Format it with a large line width (e.g., by setting `max_width = 200` in rustfmt.toml) and, in case the rustfmt bugs are later fixed, mark it with `#[rustfmt::skip]`, as it is more legible with each case on one line.
Rollup of 11 pull requests Successful merges: - rust-lang#136606 (Fix long lines which rustfmt fails to format) - rust-lang#136663 (Stabilize `NonZero::count_ones`) - rust-lang#136672 (library: doc: core::alloc::Allocator: trivial typo fix) - rust-lang#136704 (Improve examples for file locking) - rust-lang#136721 (cg_llvm: Reduce visibility of some items outside the `llvm` module) - rust-lang#136813 (rustc_target: Add the fp16 target feature for AArch32) - rust-lang#136830 (fix i686-unknown-hurd-gnu x87 footnote) - rust-lang#136832 (Fix platform support table for i686-unknown-uefi) - rust-lang#136835 (Stop using span hack for contracts feature gating) - rust-lang#136837 (Overhaul how contracts are lowered on fn-like bodies) - rust-lang#136839 (fix ensure_monomorphic_enough) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136606 - thaliaarchi:format-long-lines, r=ibraheemdev Fix long lines which rustfmt fails to format rustfmt fails to format this match expression, because it has several long string literals over the maximum line width. This seems to exhibit rustfmt issues [rust-lang#3863](rust-lang/rustfmt#3863) (Gives up on chains if any line is too long) and [rust-lang#3156](rust-lang/rustfmt#3156) (Fail to format match arm when other arm has long line). Format it with a large line width (e.g., by setting `max_width = 200` in rustfmt.toml) and, in case the rustfmt bugs are later fixed, mark it with `#[rustfmt::skip]`, as it is more legible with each case on one line.
Rollup of 11 pull requests Successful merges: - rust-lang#136606 (Fix long lines which rustfmt fails to format) - rust-lang#136663 (Stabilize `NonZero::count_ones`) - rust-lang#136672 (library: doc: core::alloc::Allocator: trivial typo fix) - rust-lang#136704 (Improve examples for file locking) - rust-lang#136721 (cg_llvm: Reduce visibility of some items outside the `llvm` module) - rust-lang#136813 (rustc_target: Add the fp16 target feature for AArch32) - rust-lang#136830 (fix i686-unknown-hurd-gnu x87 footnote) - rust-lang#136832 (Fix platform support table for i686-unknown-uefi) - rust-lang#136835 (Stop using span hack for contracts feature gating) - rust-lang#136837 (Overhaul how contracts are lowered on fn-like bodies) - rust-lang#136839 (fix ensure_monomorphic_enough) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 11 pull requests Successful merges: - rust-lang#136606 (Fix long lines which rustfmt fails to format) - rust-lang#136663 (Stabilize `NonZero::count_ones`) - rust-lang#136672 (library: doc: core::alloc::Allocator: trivial typo fix) - rust-lang#136704 (Improve examples for file locking) - rust-lang#136721 (cg_llvm: Reduce visibility of some items outside the `llvm` module) - rust-lang#136813 (rustc_target: Add the fp16 target feature for AArch32) - rust-lang#136830 (fix i686-unknown-hurd-gnu x87 footnote) - rust-lang#136832 (Fix platform support table for i686-unknown-uefi) - rust-lang#136835 (Stop using span hack for contracts feature gating) - rust-lang#136837 (Overhaul how contracts are lowered on fn-like bodies) - rust-lang#136839 (fix ensure_monomorphic_enough) r? `@ghost` `@rustbot` modify labels: rollup
rustfmt fails to format this match expression, because it has several long string literals over the maximum line width. This seems to exhibit rustfmt issues #3863 (Gives up on chains if any line is too long) and #3156 (Fail to format match arm when other arm has long line).
Format it with a large line width (e.g., by setting
max_width = 200
in rustfmt.toml) and, in case the rustfmt bugs are later fixed, mark it with#[rustfmt::skip]
, as it is more legible with each case on one line.