#[cold]
#[inline(never)]
#[track_caller]
pub fn index_out_of_bounds(index: usize, len: usize) -> ! {
panic!(
"index out of bounds: the len is {} but the index is {}",
len, index
)
}
#[cold]
#[inline(never)]
#[track_caller]
pub fn slice_index_order_fail(start: usize, end: usize) -> ! {
panic!("slice index starts at {} but ends at {}", start, end)
}
#[cold]
#[inline(never)]
#[track_caller]
pub fn slice_end_index_len_fail(end: usize, len: usize) -> ! {
panic!(
"range end index {} out of range for slice of length {}",
end, len
)
}
#[cold]
#[inline(never)]
#[track_caller]
pub fn insert_index_fail(index: usize, len: usize) -> ! {
panic!(
"insertion index (is {}) should be <= len (is {})",
index, len
)
}