1 error: index out of bounds: the len is 4 but the index is 4
2 --> $DIR/indexing_slicing.rs:18:5
4 LL | x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
7 = note: `#[deny(const_err)]` on by default
9 error: index out of bounds: the len is 4 but the index is 8
10 --> $DIR/indexing_slicing.rs:19:5
12 LL | x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
15 error: index out of bounds: the len is 4 but the index is 15
16 --> $DIR/indexing_slicing.rs:54:5
18 LL | x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
21 error: indexing may panic.
22 --> $DIR/indexing_slicing.rs:13:5
27 = note: `-D clippy::indexing-slicing` implied by `-D warnings`
28 = help: Consider using `.get(n)` or `.get_mut(n)` instead
30 error: slicing may panic.
31 --> $DIR/indexing_slicing.rs:14:6
36 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
38 error: slicing may panic.
39 --> $DIR/indexing_slicing.rs:15:6
44 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
46 error: slicing may panic.
47 --> $DIR/indexing_slicing.rs:16:6
49 LL | &x[index_from..index_to];
50 | ^^^^^^^^^^^^^^^^^^^^^^^
52 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
54 error: slicing may panic.
55 --> $DIR/indexing_slicing.rs:17:6
57 LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
58 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
60 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
62 error: slicing may panic.
63 --> $DIR/indexing_slicing.rs:17:6
65 LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
68 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
70 error: slicing may panic.
71 --> $DIR/indexing_slicing.rs:20:6
73 LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
76 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
78 error: range is out of bounds
79 --> $DIR/indexing_slicing.rs:20:8
81 LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
84 = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
86 error: slicing may panic.
87 --> $DIR/indexing_slicing.rs:21:6
92 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
94 error: slicing may panic.
95 --> $DIR/indexing_slicing.rs:22:6
100 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
102 error: indexing may panic.
103 --> $DIR/indexing_slicing.rs:30:5
108 = help: Consider using `.get(n)` or `.get_mut(n)` instead
110 error: slicing may panic.
111 --> $DIR/indexing_slicing.rs:31:6
116 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
118 error: slicing may panic.
119 --> $DIR/indexing_slicing.rs:32:6
124 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
126 error: slicing may panic.
127 --> $DIR/indexing_slicing.rs:33:6
132 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
134 error: indexing may panic.
135 --> $DIR/indexing_slicing.rs:38:5
140 = help: Consider using `.get(n)` or `.get_mut(n)` instead
142 error: indexing may panic.
143 --> $DIR/indexing_slicing.rs:39:5
148 = help: Consider using `.get(n)` or `.get_mut(n)` instead
150 error: indexing may panic.
151 --> $DIR/indexing_slicing.rs:40:5
156 = help: Consider using `.get(n)` or `.get_mut(n)` instead
158 error: slicing may panic.
159 --> $DIR/indexing_slicing.rs:41:6
164 = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
166 error: slicing may panic.
167 --> $DIR/indexing_slicing.rs:42:6
169 LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
172 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
174 error: range is out of bounds
175 --> $DIR/indexing_slicing.rs:42:8
177 LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
180 error: slicing may panic.
181 --> $DIR/indexing_slicing.rs:43:6
186 = help: Consider using `.get(n..)` or .get_mut(n..)` instead
188 error: slicing may panic.
189 --> $DIR/indexing_slicing.rs:44:6
194 = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
196 error: indexing may panic.
197 --> $DIR/indexing_slicing.rs:56:5
202 = help: Consider using `.get(n)` or `.get_mut(n)` instead
204 error: indexing may panic.
205 --> $DIR/indexing_slicing.rs:57:5
210 = help: Consider using `.get(n)` or `.get_mut(n)` instead
212 error: aborting due to 27 previous errors