Make {str,[u8]}::eq_ignore_ascii_case const#104126
Make {str,[u8]}::eq_ignore_ascii_case const#104126coolreader18 wants to merge 1 commit intorust-lang:masterfrom
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}caseconst too, but I realized that requires const_mut_refs andu8/char::make_ascii_*casearen'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 haveconstadded (maybeis_ascii, but it'd need a bunch of extra unstably-const ptr methods), and alsoeq_ignore_ascii_casecodegen'd worse with the const-friendly while loop version, so I had to useconst_eval_selectfor both.