From c710461b02660cef1d077420d5b486b1d8f1f28b Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Sat, 25 Apr 2020 21:18:47 -0400 Subject: [PATCH] Added some unsafety documentation to partition_equal --- src/libcore/slice/sort.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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