about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-29 03:11:39 -0700
committerGitHub <noreply@github.com>2024-10-29 03:11:39 -0700
commitb496974c5363044ae134722aeaa4d0ae89de74c0 (patch)
treea11457c09df05869d3c4d6e46b18453e4b9f169d /compiler/rustc_codegen_llvm/src
parent5d0f52efa4b774ffa066d0f40a22242dc7fbbfba (diff)
parentaa493d0b6020f0f166d2e3a2628761b7428a12a1 (diff)
downloadrust-b496974c5363044ae134722aeaa4d0ae89de74c0.tar.gz
rust-b496974c5363044ae134722aeaa4d0ae89de74c0.zip
Rollup merge of #131520 - zachs18:const-str-split, r=Noratrieb
Mark `str::is_char_boundary` and `str::split_at*` unstably `const`.

Tracking issues: #131516, #131518

First commit implements `const_is_char_boundary`, second commit implements `const_str_split_at` (which depends on `const_is_char_boundary`)

~~I used `const_eval_select` for `is_char_boundary` since there is a comment about optimizations that would theoretically not happen with the simple `const`-compatible version (since `slice::get` is not `const`ifiable) cc #84751. I have not checked if this code difference is still required for the optimization, so it might not be worth the code complication, but 🤷.~~

This changes `str::split_at_checked` to use a new private helper function `split_at_unchecked` (copied from `split_at_mut_unchecked`) that does pointer stuff instead of `get_unchecked`, since that is not currently `const`ifiable due to using the `SliceIndex` trait.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions