-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make char and u8 methods const #82078
Conversation
r? @KodrAus (rust-highfive has picked a reviewer for you, use r? to override) |
@rfcbot merge |
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Cc @rust-lang/wg-const-eval |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
While these changes are all trivial, is it appropriate for these to go from non-existent to stable directly? I thought it was required that everything pass through nightly. |
This will be on nightly for at least 6 weeks no matter what prior to a stable release. There is no requirement that something be on nightly for 12+ weeks. 6 is sufficient here. |
Did not know that. I always assumed it had to be on nightly for a full cycle (thus shipping a beta with it unstable). Good to know, though, given that I'm going through a bunch of functions like this to see what can be |
☔ The latest upstream changes (presumably #82430) made this pull request unmergeable. Please resolve the merge conflicts. |
`escape_unicode`, `escape_default`, `len_utf8`, `len_utf16`, to_ascii_lowercase`, `eq_ignore_ascii_case` `u8` methods `to_ascii_lowercase`, `to_ascii_uppercase` also must be made const u8 methods made const Update methods.rs Update mod.rs Update methods.rs Fix `since` in rustc_const_stable to next stable Fix `since` in rustc_const_stable to next stable Update methods.rs Update mod.rs
Rebases and makes changes required by the recent merge of #81837.
Rebase and make a change to pull in #81837. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
@bors r+ |
📌 Commit 1ed9dd4 has been approved by |
Make char and u8 methods const char methods `len_utf8`, `len_utf16`, `to_ascii_lowercase`, `eq_ignore_ascii_case` can be made const. `u8` methods `to_ascii_lowercase`, `to_ascii_uppercase` are required to be const as well. `u8::eq_ignore_ascii_case` was additionally made const. Rebase of rust-lang#79549 originally authored by `@YenForYang.` Changes from that PR: - Squashed all commits from rust-lang#79549. - rebased to latest upstream master. - Removed const attributes for `char::escape_unicode` and `char::escape_default`. - Updated `since` attributes for `const` stabilization to 1.52.0. cc `@m-ou-se.`
Rollup of 16 pull requests Successful merges: - rust-lang#75807 (Convert core/num/mod.rs to intra-doc links) - rust-lang#80534 (Use #[doc = include_str!()] in std) - rust-lang#80553 (Add an impl of Error on `Arc<impl Error>`.) - rust-lang#81167 (Make ptr::write const) - rust-lang#81575 (rustdoc: Name fields of `ResolutionFailure::WrongNamespace`) - rust-lang#81713 (Account for associated consts in the "unstable assoc item name colission" lint) - rust-lang#82078 (Make char and u8 methods const) - rust-lang#82087 (Fix ICE caused by suggestion with no code substitutions) - rust-lang#82090 (Do not consider using a semicolon inside of a different-crate macro) - rust-lang#82213 (Slices for vecs) - rust-lang#82214 (Remove redundant to_string calls) - rust-lang#82220 (fix the false 'defined here' messages) - rust-lang#82313 (Update normalize.css to 8.0.1) - rust-lang#82321 (AST: Remove some unnecessary boxes) - rust-lang#82364 (Improve error msgs when found type is deref of expected) - rust-lang#82514 (Update Clippy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
char methods
len_utf8
,len_utf16
,to_ascii_lowercase
,eq_ignore_ascii_case
can be made const.u8
methodsto_ascii_lowercase
,to_ascii_uppercase
are required to be const as well.u8::eq_ignore_ascii_case
was additionally made const.Rebase of #79549 originally authored by @YenForYang. Changes from that PR:
char::escape_unicode
andchar::escape_default
.since
attributes forconst
stabilization to 1.52.0.cc @m-ou-se.