diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index 046b2f6c13ad..2ec4f43b1f78 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -435,15 +435,17 @@ where // Find the first pair of out-of-order elements. let mut l = 0; let mut r = v.len(); + + // SAFETY: The unsafety below involves indexing an array. + // For the first one: we already do the bound checking here with `l