-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make {str,[u8]}::eq_ignore_ascii_case const #104126
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
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
2a197fa
to
c3e7c70
Compare
Failure was just that I forgot to add SAFETY comments for the unsafe blocks. |
☔ The latest upstream changes (presumably #102795) made this pull request unmergeable. Please resolve the merge conflicts. |
c3e7c70
to
0b6b4ee
Compare
Not much movement on this yet so cc @rust-lang/wg-const-eval in case anyone has any thoughts on this. |
I think this is okay (because it doesn't use const traits) but I think libs-api should have a say on whether use of |
☔ The latest upstream changes (presumably #111113) made this pull request unmergeable. Please resolve the merge conflicts. |
0b6b4ee
to
fd78ba1
Compare
Actually, I really don't feel strongly about just |
Both of these can trivially be implemented with already-const-stable language constructs/functions, so I figured it would make sense to make them const. I was going to make
make_ascii_{upper,lower}case
const too, but I realized that requires const_mut_refs andu8/char::make_ascii_*case
aren't even unstably const under that, so I figured I'd leave that for after that's stabilized. Also, unfortunately, neither of the existing implementations can just haveconst
added (maybeis_ascii
, but it'd need a bunch of extra unstably-const ptr methods), and alsoeq_ignore_ascii_case
codegen'd worse with the const-friendly while loop version, so I had to useconst_eval_select
for both.