From 9e1e989f7cfbc9bb35511acdeb51b3122bf717a2 Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Sat, 25 Apr 2020 19:46:53 -0400 Subject: [PATCH] Document unsafety in partial_insertion_sort We already implicitly (or explicitly??) do the bound checking for the indexing. --- src/libcore/slice/sort.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index 0177c5a9ffdf..937995e2fe0a 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