From 105ae712f4f136adb7c94f1cfa35da30bd0e4952 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Thu, 25 Oct 2018 14:59:14 +0900 Subject: [PATCH] update_references indexing_slicing --- tests/ui/indexing_slicing.stderr | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/ui/indexing_slicing.stderr b/tests/ui/indexing_slicing.stderr index fafcb1bc485..14e9627e573 100644 --- a/tests/ui/indexing_slicing.stderr +++ b/tests/ui/indexing_slicing.stderr @@ -1,3 +1,29 @@ +error: index out of bounds: the len is 4 but the index is 4 + --> $DIR/indexing_slicing.rs:28:5 + | +28 | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays. + | ^^^^ + | + = note: #[deny(const_err)] on by default + +error: index out of bounds: the len is 4 but the index is 8 + --> $DIR/indexing_slicing.rs:29:5 + | +29 | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays. + | ^^^^^^^^^ + +error: index out of bounds: the len is 0 but the index is 0 + --> $DIR/indexing_slicing.rs:59:5 + | +59 | empty[0]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays. + | ^^^^^^^^ + +error: index out of bounds: the len is 4 but the index is 15 + --> $DIR/indexing_slicing.rs:90:5 + | +90 | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays. + | ^^^^ + error: indexing may panic. --> $DIR/indexing_slicing.rs:23:5 | @@ -279,5 +305,5 @@ error: range is out of bounds 98 | &x[10..num]; // should trigger out of bounds error | ^^ -error: aborting due to 39 previous errors +error: aborting due to 43 previous errors -- 2.44.0