Skip to content
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

Tracking Issue for const_make_ascii #130698

Closed
5 tasks done
bjoernager opened this issue Sep 22, 2024 · 7 comments · Fixed by #131496
Closed
5 tasks done

Tracking Issue for const_make_ascii #130698

bjoernager opened this issue Sep 22, 2024 · 7 comments · Fixed by #131496
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@bjoernager
Copy link
Contributor

bjoernager commented Sep 22, 2024

Feature gate: #![feature(const_make_ascii)]

This is a tracking issue for marking the make_ascii_uppercase and make_ascii_lowercase methods in char, u8, [u8], and str as "const."

Public API

impl char {
    pub const fn make_ascii_uppercase(&mut self);

    pub const fn make_ascii_lowercase(&mut self);
}

impl u8 {
    pub const fn make_ascii_uppercase(&mut self);

    pub const fn make_ascii_lowercase(&mut self);
}

impl [u8] {
    pub const fn make_ascii_uppercase(&mut self);

    pub const fn make_ascii_lowercase(&mut self);
}

impl str {
    pub const fn make_ascii_uppercase(&mut self);

    pub const fn make_ascii_lowercase(&mut self);
}

Steps / History

Unresolved Questions

  • None yet.
@bjoernager bjoernager added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 22, 2024
@dtolnay
Copy link
Member

dtolnay commented Sep 22, 2024

@rust-lang/libs-api:
@rfcbot fcp merge

to_ascii_uppercase/to_ascii_lowercase have been stable in const since 1.52. make_ascii_uppercase/make_ascii_lowercase are unblocked now by the stabilization of #57349.

@rfcbot
Copy link

rfcbot commented Sep 22, 2024

Team member @dtolnay 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.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2024
…dtolnay

Mark `char::make_ascii_uppercase` and `char::make_ascii_lowercase` as const.

Relevant tracking issue: rust-lang#130698

The `make_ascii_uppercase` and `make_ascii_lowercase` methods in `char` should be marked "const."

With the stabilisation of [`const_mut_refs`](rust-lang#57349), this simply requires adding the `const` specifier to the function signatures.
@okaneco
Copy link
Contributor

okaneco commented Sep 22, 2024

Can the u8 methods be included in this?
https://doc.rust-lang.org/stable/std/primitive.u8.html#method.make_ascii_lowercase
https://doc.rust-lang.org/stable/std/primitive.u8.html#method.make_ascii_uppercase

Similarly const stable u8::to_ascii_uppercase/u8::to_ascii_lowercase since 1.52.

@bjoernager
Copy link
Contributor Author

Yes, that sounds like a good idea. I'll try adding another PR later.

@bjoernager bjoernager changed the title Tracking Issue for const_char_make_ascii Tracking Issue for const_make_ascii Sep 22, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 22, 2024
…r=Noratrieb

Mark `u8::make_ascii_uppercase` and `u8::make_ascii_lowercase` as const.

Relevant tracking issue: rust-lang#130698

This PR extends rust-lang#130697 by also marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `u8` as const.

The `const_char_make_ascii` feature gate is additionally renamed to `const_make_ascii`.
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Sep 23, 2024
…r=Noratrieb

Mark `u8::make_ascii_uppercase` and `u8::make_ascii_lowercase` as const.

Relevant tracking issue: rust-lang#130698

This PR extends rust-lang#130697 by also marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `u8` as const.

The `const_char_make_ascii` feature gate is additionally renamed to `const_make_ascii`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 23, 2024
…r=Noratrieb

Mark `u8::make_ascii_uppercase` and `u8::make_ascii_lowercase` as const.

Relevant tracking issue: rust-lang#130698

This PR extends rust-lang#130697 by also marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `u8` as const.

The `const_char_make_ascii` feature gate is additionally renamed to `const_make_ascii`.
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 23, 2024
Rollup merge of rust-lang#130713 - bjoernager:const-char-make-ascii, r=Noratrieb

Mark `u8::make_ascii_uppercase` and `u8::make_ascii_lowercase` as const.

Relevant tracking issue: rust-lang#130698

This PR extends rust-lang#130697 by also marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `u8` as const.

The `const_char_make_ascii` feature gate is additionally renamed to `const_make_ascii`.
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 24, 2024
Mark `make_ascii_uppercase` and `make_ascii_lowercase` in `[u8]` and `str` as const.

Relevant tracking issue: rust-lang#130698

This PR extends rust-lang#130697 and rust-lang#130713 to the similar methods in byte slices (`[u8]`) and string slices (`str`).

For the `str` methods, this simply requires adding the `const` specifier to the function signatures. The `[u8]` methods, however, require (at least a temporary) reimplementation due to the use of iterators and `for` loops.
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Oct 1, 2024
@rfcbot
Copy link

rfcbot commented Oct 1, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@bjoernager
Copy link
Contributor Author

#131496 stabilises this.

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 11, 2024
@rfcbot
Copy link

rfcbot commented Oct 11, 2024

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.

This will be merged soon.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Oct 11, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 14, 2024
…lnay

Stabilise `const_make_ascii`.

Closes: rust-lang#130698

This PR stabilises the `const_make_ascii` feature gate (i.e. marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `char`, `u8`, `[u8]`, and `str` as const).
@bors bors closed this as completed in 9716a42 Oct 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 15, 2024
Rollup merge of rust-lang#131496 - bjoernager:const-make-ascii, r=dtolnay

Stabilise `const_make_ascii`.

Closes: rust-lang#130698

This PR stabilises the `const_make_ascii` feature gate (i.e. marking the `make_ascii_uppercase` and `make_ascii_lowercase` methods in `char`, `u8`, `[u8]`, and `str` as const).
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Oct 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants