]> git.lizzy.rs Git - rust.git/commitdiff
Update src/libcore/tests/slice.rs
authorkennytm <kennytm@gmail.com>
Mon, 3 Jun 2019 16:27:28 +0000 (00:27 +0800)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2019 16:27:28 +0000 (00:27 +0800)
Co-Authored-By: Jack O'Connor <oconnor663@gmail.com>
src/libcore/tests/slice.rs

index 401757295922278bca01672d0f609e3ec64fa847..eaa799fa96ee2d5abc0b9f8c05db5b2106299a59 100644 (file)
@@ -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);
 }