Instruct LLVM that binary_search_by returns a valid index
This commit is contained in:
parent
51748a8fc7
commit
f43c02236d
1 changed files with 2 additions and 0 deletions
|
@ -2204,6 +2204,8 @@ impl<T> [T] {
|
|||
} else if cmp == Greater {
|
||||
right = mid;
|
||||
} else {
|
||||
// SAFETY: same as the `get_unchecked` above
|
||||
unsafe { crate::intrinsics::assume(mid < self.len()) };
|
||||
return Ok(mid);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue