From 427f1a49f677395fbc4415f2917207fb7e4bc061 Mon Sep 17 00:00:00 2001 From: kennytm Date: Tue, 4 Jun 2019 00:27:28 +0800 Subject: [PATCH] Update src/libcore/tests/slice.rs Co-Authored-By: Jack O'Connor --- src/libcore/tests/slice.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/tests/slice.rs b/src/libcore/tests/slice.rs index 4017572959222..eaa799fa96ee2 100644 --- a/src/libcore/tests/slice.rs +++ b/src/libcore/tests/slice.rs @@ -1547,7 +1547,7 @@ fn test_copy_within_panics_src_inverted() { #[should_panic(expected = "attempted to index slice up to maximum usize")] fn test_copy_within_panics_src_out_of_bounds() { let mut bytes = *b"Hello, World!"; - // 2 is greater than 1, so this range is invalid. + // an inclusive range ending at usize::max_value() would make src_end overflow bytes.copy_within(usize::max_value()..=usize::max_value(), 0); }