-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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_char_encode_utf8
#130512
Comments
@rfcbot fcp merge
|
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. |
I'll note that in the implementation PR, making this const seems to require making the panic error message worse (even in the case where |
The use of unsafe code cannot be avoided as long as slice indexes aren't const-friendly (AFAIK). But I would argue that this use is properly documented and (relatively) invulnerable to UB, although I am open to other views on this. @RalfJung has also noted that |
We could have a safe "const fn subslice" that does the bounds check and then uses unsafe from_raw_parts. That would avoid introducing new unsafe reasoning in encode_utf8 itself.
|
#130611 resolves the diagnostics question. Can this be added without conflicting with the FCP? |
@bjoernager Yeah that should be fine. Thank you! I appreciate that. :-) |
Plesse add a FIXME(const-hack) next to the const-eval-select to document that it should be removed again in the future, when possible.
|
Done. :) |
… r=dtolnay Address diagnostics regression for `const_char_encode_utf8`. Relevant tracking issue: rust-lang#130512 This PR regains full diagnostics for non-const calls to `char::encode_utf8`.
Rollup merge of rust-lang#130611 - bjoernager:const-char-encode-utf8, r=dtolnay Address diagnostics regression for `const_char_encode_utf8`. Relevant tracking issue: rust-lang#130512 This PR regains full diagnostics for non-const calls to `char::encode_utf8`.
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Am I supposed to draft a stabilisation PR or is that outside my domain? |
If you want to then yes you can draft a stabilization PR. :) Please link it to this issue and mention that it must only land once FCP has completed. |
#131463 stabilises this. |
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. |
… r=RalfJung Stabilise `const_char_encode_utf8`. Closes: rust-lang#130512 This PR stabilises the `const_char_encode_utf8` feature gate (i.e. support for `char::encode_utf8` in const scenarios). Note that the linked tracking issue is currently awaiting FCP.
Rollup merge of rust-lang#131463 - bjoernager:const-char-encode-utf8, r=RalfJung Stabilise `const_char_encode_utf8`. Closes: rust-lang#130512 This PR stabilises the `const_char_encode_utf8` feature gate (i.e. support for `char::encode_utf8` in const scenarios). Note that the linked tracking issue is currently awaiting FCP.
Feature gate:
#![feature(const_char_encode_utf8)]
This is a tracking issue for supporting
char::encode_utf8
in const scenarios.Public API
Steps / History
char::encode_utf8
in const scenarios. #130511const_char_encode_utf8
. #130611const_char_encode_utf8
. #131463Unresolved Questions
The text was updated successfully, but these errors were encountered: