-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix FormattingOptions
instantiation with Default
#135977
Conversation
This comment has been minimized.
This comment has been minimized.
0fc0807
to
497a28b
Compare
The `fill` value by default should be set to `' '` (space), but the current implementation uses `#[derive(Default)]` which sets it to `\0`
497a28b
to
c9ae0bb
Compare
afaik we generally don't backport changes that only affect unstable APIs, since they're intended to only work on nightly, not beta or stable. If this fixes some stable API then that's a different story. |
@bors r+ rollup |
Fix `FormattingOptions` instantiation with `Default` The `fill` value by default should be set to `' '` (space), but the current implementation uses `#[derive(Default)]` which sets it to `\0`. Note that `FormattingOptions` is being released as part of 1.85 (unstable) - so this might warrant a backport to that branch. Tracking issue: rust-lang#118117 Follow up from rust-lang#118159 CC: `@EliasHolzmann` `@programmerjake` r? `@m-ou-se`
Rollup of 6 pull requests Successful merges: - rust-lang#135728 (document order of items in iterator from drain) - rust-lang#135829 (Rustc dev guide subtree update) - rust-lang#135886 (Document purpose of closure in from_fn.rs more clearly) - rust-lang#135977 (Fix `FormattingOptions` instantiation with `Default`) - rust-lang#135983 (Doc difference between extend and extend_from_slice) - rust-lang#135985 (Rename test to `unresolvable-upvar-issue-87987.rs` and add some notes) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#135971 (Properly report error when object type param default references self) - rust-lang#135977 (Fix `FormattingOptions` instantiation with `Default`) - rust-lang#135985 (Rename test to `unresolvable-upvar-issue-87987.rs` and add some notes) - rust-lang#135991 (Fix set_name in thread mod for NuttX) - rust-lang#136009 (bootstrap: Handle bootstrap lockfile race condition better) - rust-lang#136018 (Use short ty string for move errors) - rust-lang#136027 (Skip suggestions in `derive`d code) - rust-lang#136029 (Bootstrap: Don't move ownership of job object) - rust-lang#136034 (fix(bootstrap): deserialize null as `f64::NAN`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135977 - nyurik:fix-fmt-options, r=joboet Fix `FormattingOptions` instantiation with `Default` The `fill` value by default should be set to `' '` (space), but the current implementation uses `#[derive(Default)]` which sets it to `\0`. Note that `FormattingOptions` is being released as part of 1.85 (unstable) - so this might warrant a backport to that branch. Tracking issue: rust-lang#118117 Follow up from rust-lang#118159 CC: ``@EliasHolzmann`` ``@programmerjake`` r? ``@m-ou-se``
@nyurik Thanks, nice catch! |
"There is (now) a lint for that" (tm) |
The
fill
value by default should be set to' '
(space), but the current implementation uses#[derive(Default)]
which sets it to\0
.Note that
FormattingOptions
is being released as part of 1.85 (unstable) - so this might warrant a backport to that branch.Tracking issue: #118117
Follow up from #118159
CC: @EliasHolzmann @programmerjake
r? @m-ou-se