diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/slice/sort.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index 0177c5a9ffd..937995e2fe0 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -131,6 +131,8 @@ where let mut i = 1; for _ in 0..MAX_STEPS { + // SAFETY: We already explicitly done the bound checking with `i<len` + // All our indexing following that is only in the range {0 <= index < len} unsafe { // Find the next pair of adjacent out-of-order elements. while i < len && !is_less(v.get_unchecked(i), v.get_unchecked(i - 1)) { |
