Skip to content

Conversation

EliasHolzmann
Copy link
Contributor

@EliasHolzmann EliasHolzmann commented Aug 26, 2025

Related to #118117.

Having const fns that take a mut & was unstable until Rust 1.83 (see #129195). Because of this, not all methods on FormattingOptions were implemented as const. As this has been stabilized now, there is no reason not to have all methods const.

Thanks to @Ternvein for bringing this to my attention (see 1).

r? @m-ou-se (As you were the reviewer for the original implementation – feel free to reroll if you are busy or if you aren't interested)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 26, 2025
@rustbot

This comment has been minimized.

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the username mention from the commit message (just dropping the @ is fine).

View changes since this review

Having `const fn`s that take a `mut &` was unstable until Rust 1.83. Because of
this, not all methods on `FormattingOptions` were implemented as `const`. As
this has been stabilized now, there is no reason not to have all methods
`const`.

Thanks to Ternvein for bringing this to my attention (see [1]).

[1]: rust-lang#118117 (comment)
@EliasHolzmann EliasHolzmann force-pushed the formatting_options_20250825 branch from 89c3389 to 575a90e Compare August 26, 2025 01:43
@EliasHolzmann
Copy link
Contributor Author

@jieyouxu Done (also removed the mentioned PR ID). Sorry, didn't check this PR after creating it because I thought the CI would take a while anyway.

@jieyouxu
Copy link
Member

No worries, that's completely fine. This is why there's an automated warning message 😁

@m-ou-se
Copy link
Member

m-ou-se commented Aug 26, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 26, 2025

📌 Commit 575a90e has been approved by m-ou-se

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2025
bors added a commit that referenced this pull request Aug 26, 2025
Rollup of 11 pull requests

Successful merges:

 - #144373 (remove deprecated Error::description in impls)
 - #144551 (Add aarch64_be-unknown-linux-musl target)
 - #145076 (Add new Tier-3 target: riscv64a23-unknown-linux-gnu)
 - #145481 (Add parentheses for closure when suggesting calling closure)
 - #145596 (Losslessly optimize PNG files)
 - #145615 (Fix doc of `std::os::windows::io::BorrowedSocket::borrow_raw`)
 - #145841 (Always build miri for the host in `x run miri`)
 - #145861 (bootstrap: vendor `clippy_test_deps` too)
 - #145863 (formatting_options: Make all methods `const`)
 - #145867 (cg_llvm: Assert that LLVM range-attribute values don't exceed 128 bits)
 - #145875 (Make bootstrap command caching opt-in)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5d95ec0 into rust-lang:master Aug 26, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 26, 2025
rust-timer added a commit that referenced this pull request Aug 26, 2025
Rollup merge of #145863 - EliasHolzmann:formatting_options_20250825, r=m-ou-se

formatting_options: Make all methods `const`

Related to #118117.

Having `const fn`s that take a `mut &` was unstable until Rust 1.83 (see #129195). Because of this, not all methods on `FormattingOptions` were implemented as `const`. As this has been stabilized now, there is no reason not to have all methods `const`.

Thanks to `@Ternvein` for bringing this to my attention (see [1]).

r? `@m-ou-se` (As you were the reviewer for the original implementation – feel free to reroll if you are busy or if you aren't interested)

[1]: #118117 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants