Rollup merge of #130659 - bjoernager:const-char-encode-utf16, r=dtolnay

Support `char::encode_utf16` in const scenarios.

Relevant tracking issue: #130660

The method `char::encode_utf16` should be marked "const" to allow compile-time conversions.

This PR additionally rewrites the `encode_utf16_raw` function for better readability whilst also reducing the amount of unsafe code.

try-job: x86_64-msvc
This commit is contained in:
Matthias Krüger
2024-09-23 06:45:33 +02:00
committed by GitHub
2 changed files with 37 additions and 26 deletions

View File

@@ -119,6 +119,7 @@
#![feature(const_bigint_helper_methods)]
#![feature(const_black_box)]
#![feature(const_cell_into_inner)]
#![feature(const_char_encode_utf16)]
#![feature(const_char_encode_utf8)]
#![feature(const_eval_select)]
#![feature(const_exact_div)]