Mark slice_error_fail as a cold path

This commit is contained in:
Manish Goregaokar 2015-11-23 09:34:01 +05:30
parent eb19d024a9
commit c0f9a39e5c
1 changed files with 1 additions and 0 deletions

View File

@ -1441,6 +1441,7 @@ pub trait StrExt {
}
#[inline(never)]
#[cold]
fn slice_error_fail(s: &str, begin: usize, end: usize) -> ! {
assert!(begin <= end);
panic!("index {} and/or {} in `{}` do not lie on character boundary",