-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add MAX_LEN_UTF8
and MAX_LEN_UTF16
Constants
#120580
base: master
Are you sure you want to change the base?
Add MAX_LEN_UTF8
and MAX_LEN_UTF16
Constants
#120580
Conversation
MAX_LEN_UTF8
and MAX_LEN_UTF16
constantsMAX_LEN_UTF8
and MAX_LEN_UTF16
Constants
r? @m-ou-se (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #121295) made this pull request unmergeable. Please resolve the merge conflicts. |
In the tracking issue, please include a mention that when stabilizing this we should adjust the documentation of https://doc.rust-lang.org/std/primitive.char.html#method.encode_utf8 to use it. |
We briefly discussed this in the libs-api meeting and are happy to add these as unstable. |
Tracking issue created. Will finish the remaining things later today. |
177bcc3
to
ae30dc9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f51dde5
to
bee9b68
Compare
@rustbot ready |
☔ The latest upstream changes (presumably #116113) made this pull request unmergeable. Please resolve the merge conflicts. |
Small question: why are these constants in the |
From what I can tell, in this PR they are added as associated constants on |
Oh, I completely missed that point. I personally wouldn't add module exports since that way there's just one way to access them. We've also been deprecating the module equivalents of associated consts in a bunch of places, and so adding a new one doesn't make much sense. |
bee9b68
to
4b750dc
Compare
4b750dc
to
c803be1
Compare
☔ The latest upstream changes (presumably #130165) made this pull request unmergeable. Please resolve the merge conflicts. |
This pull request adds the
MAX_LEN_UTF8
andMAX_LEN_UTF16
constants as per #45795, gated behind thechar_max_len
feature.The constants are currently applied in the
alloc
,core
andstd
libraries.