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

Tracking Issue for const_unicode_case_lookup #101400

Open
1 of 3 tasks
mx00s opened this issue Sep 3, 2022 · 2 comments
Open
1 of 3 tasks

Tracking Issue for const_unicode_case_lookup #101400

mx00s opened this issue Sep 3, 2022 · 2 comments
Labels
A-unicode Area: Unicode C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@mx00s
Copy link
Contributor

mx00s commented Sep 3, 2022

Feature gate: #![feature(const_unicode_case_lookup)]

This is a tracking issue for making char::is_lowercase and char::is_uppercase const.

Public API

const CAPITAL_DELTA_IS_UPPERCASE: bool = 'Δ'.is_uppercase();

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@mx00s mx00s added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 3, 2022
mx00s added a commit to mx00s/rust that referenced this issue Sep 4, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 4, 2022
Make `char::is_lowercase` and `char::is_uppercase` const

Implements rust-lang#101400.
@workingjubilee workingjubilee added the A-unicode Area: Unicode label Jul 22, 2023
@DaniPopes
Copy link
Contributor

DaniPopes commented Sep 28, 2023

This has been unstable for more than a year, and since there are no reported issues or blockers I think this can be stabilized.

The full API is making char::{is_lowercase,is_uppercase} const-stable.

@dtolnay
Copy link
Member

dtolnay commented Oct 2, 2023

From skimming the implementation PR, I am apprehensive about seeing it convert many Unicode tables from static to const. Consts are defined to behave as if their definition is copy-pasted at every use. Statics are not; they appear at most once, at a single address. See also #82676.

I would not want to regret being forced to define Unicode tables as const when we later find that static's semantics are more appropriate for them.

It would be good to get reassurance from a compiler perspective about whether committing to representing Unicode tables as const is going to be problematic.

@dtolnay dtolnay added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-unicode Area: Unicode C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants