Make const_eval_select a real intrinsic

This commit is contained in:
Deadbeef
2022-08-23 00:07:26 +00:00
parent 8521a8c92d
commit 075084f772
27 changed files with 432 additions and 287 deletions

View File

@@ -91,10 +91,12 @@ const fn slice_error_fail(s: &str, begin: usize, end: usize) -> ! {
}
}
#[track_caller]
const fn slice_error_fail_ct(_: &str, _: usize, _: usize) -> ! {
panic!("failed to slice string");
}
#[track_caller]
fn slice_error_fail_rt(s: &str, begin: usize, end: usize) -> ! {
const MAX_DISPLAY_LENGTH: usize = 256;
let trunc_len = s.floor_char_boundary(MAX_DISPLAY_LENGTH);