]> git.lizzy.rs Git - rust.git/commitdiff
update_references indexing_slicing
authorShotaro Yamada <sinkuu@sinkuu.xyz>
Thu, 25 Oct 2018 05:59:14 +0000 (14:59 +0900)
committerShotaro Yamada <sinkuu@sinkuu.xyz>
Thu, 25 Oct 2018 16:16:14 +0000 (01:16 +0900)
tests/ui/indexing_slicing.stderr

index fafcb1bc4853f13d8655bf8b1e7b91d11980e961..14e9627e57344c0bde16b83e538048ac13d88465 100644 (file)
@@ -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