]> git.lizzy.rs Git - rust.git/blob - tests/ui/indexing_slicing.stderr
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / indexing_slicing.stderr
1 error: indexing may panic.
2   --> $DIR/indexing_slicing.rs:13:5
3    |
4 13 |     x[index];
5    |     ^^^^^^^^
6    |
7    = note: `-D clippy::indexing-slicing` implied by `-D warnings`
8    = help: Consider using `.get(n)` or `.get_mut(n)` instead
9
10 error: slicing may panic.
11   --> $DIR/indexing_slicing.rs:14:6
12    |
13 14 |     &x[index..];
14    |      ^^^^^^^^^^
15    |
16    = help: Consider using `.get(n..)` or .get_mut(n..)` instead
17
18 error: slicing may panic.
19   --> $DIR/indexing_slicing.rs:15:6
20    |
21 15 |     &x[..index];
22    |      ^^^^^^^^^^
23    |
24    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
25
26 error: slicing may panic.
27   --> $DIR/indexing_slicing.rs:16:6
28    |
29 16 |     &x[index_from..index_to];
30    |      ^^^^^^^^^^^^^^^^^^^^^^^
31    |
32    = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
33
34 error: slicing may panic.
35   --> $DIR/indexing_slicing.rs:17:6
36    |
37 17 |     &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
38    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
39    |
40    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
41
42 error: slicing may panic.
43   --> $DIR/indexing_slicing.rs:17:6
44    |
45 17 |     &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
46    |      ^^^^^^^^^^^^^^^
47    |
48    = help: Consider using `.get(n..)` or .get_mut(n..)` instead
49
50 error: range is out of bounds
51   --> $DIR/indexing_slicing.rs:20:6
52    |
53 20 |     &x[..=4];
54    |      ^^^^^^^
55    |
56    = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
57
58 error: range is out of bounds
59   --> $DIR/indexing_slicing.rs:21:6
60    |
61 21 |     &x[1..5];
62    |      ^^^^^^^
63
64 error: slicing may panic.
65   --> $DIR/indexing_slicing.rs:22:6
66    |
67 22 |     &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
68    |      ^^^^^^^^^^^^
69    |
70    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
71
72 error: range is out of bounds
73   --> $DIR/indexing_slicing.rs:22:6
74    |
75 22 |     &x[5..][..10]; // Two lint reports, one for [5..] and another for [..10].
76    |      ^^^^^^
77
78 error: range is out of bounds
79   --> $DIR/indexing_slicing.rs:23:6
80    |
81 23 |     &x[5..];
82    |      ^^^^^^
83
84 error: range is out of bounds
85   --> $DIR/indexing_slicing.rs:24:6
86    |
87 24 |     &x[..5];
88    |      ^^^^^^
89
90 error: range is out of bounds
91   --> $DIR/indexing_slicing.rs:25:6
92    |
93 25 |     &x[5..].iter().map(|x| 2 * x).collect::<Vec<i32>>();
94    |      ^^^^^^
95
96 error: range is out of bounds
97   --> $DIR/indexing_slicing.rs:26:6
98    |
99 26 |     &x[0..=4];
100    |      ^^^^^^^^
101
102 error: slicing may panic.
103   --> $DIR/indexing_slicing.rs:27:6
104    |
105 27 |     &x[0..][..3];
106    |      ^^^^^^^^^^^
107    |
108    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
109
110 error: slicing may panic.
111   --> $DIR/indexing_slicing.rs:28:6
112    |
113 28 |     &x[1..][..5];
114    |      ^^^^^^^^^^^
115    |
116    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
117
118 error: indexing may panic.
119   --> $DIR/indexing_slicing.rs:41:5
120    |
121 41 |     y[0];
122    |     ^^^^
123    |
124    = help: Consider using `.get(n)` or `.get_mut(n)` instead
125
126 error: slicing may panic.
127   --> $DIR/indexing_slicing.rs:42:6
128    |
129 42 |     &y[1..2];
130    |      ^^^^^^^
131    |
132    = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
133
134 error: slicing may panic.
135   --> $DIR/indexing_slicing.rs:43:6
136    |
137 43 |     &y[0..=4];
138    |      ^^^^^^^^
139    |
140    = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
141
142 error: slicing may panic.
143   --> $DIR/indexing_slicing.rs:44:6
144    |
145 44 |     &y[..=4];
146    |      ^^^^^^^
147    |
148    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
149
150 error: range is out of bounds
151   --> $DIR/indexing_slicing.rs:50:6
152    |
153 50 |     &empty[1..5];
154    |      ^^^^^^^^^^^
155
156 error: range is out of bounds
157   --> $DIR/indexing_slicing.rs:51:6
158    |
159 51 |     &empty[0..=4];
160    |      ^^^^^^^^^^^^
161
162 error: range is out of bounds
163   --> $DIR/indexing_slicing.rs:52:6
164    |
165 52 |     &empty[..=4];
166    |      ^^^^^^^^^^^
167
168 error: range is out of bounds
169   --> $DIR/indexing_slicing.rs:53:6
170    |
171 53 |     &empty[1..];
172    |      ^^^^^^^^^^
173
174 error: range is out of bounds
175   --> $DIR/indexing_slicing.rs:54:6
176    |
177 54 |     &empty[..4];
178    |      ^^^^^^^^^^
179
180 error: range is out of bounds
181   --> $DIR/indexing_slicing.rs:55:6
182    |
183 55 |     &empty[0..=0];
184    |      ^^^^^^^^^^^^
185
186 error: range is out of bounds
187   --> $DIR/indexing_slicing.rs:56:6
188    |
189 56 |     &empty[..=0];
190    |      ^^^^^^^^^^^
191
192 error: indexing may panic.
193   --> $DIR/indexing_slicing.rs:64:5
194    |
195 64 |     v[0];
196    |     ^^^^
197    |
198    = help: Consider using `.get(n)` or `.get_mut(n)` instead
199
200 error: indexing may panic.
201   --> $DIR/indexing_slicing.rs:65:5
202    |
203 65 |     v[10];
204    |     ^^^^^
205    |
206    = help: Consider using `.get(n)` or `.get_mut(n)` instead
207
208 error: indexing may panic.
209   --> $DIR/indexing_slicing.rs:66:5
210    |
211 66 |     v[1 << 3];
212    |     ^^^^^^^^^
213    |
214    = help: Consider using `.get(n)` or `.get_mut(n)` instead
215
216 error: slicing may panic.
217   --> $DIR/indexing_slicing.rs:67:6
218    |
219 67 |     &v[10..100];
220    |      ^^^^^^^^^^
221    |
222    = help: Consider using `.get(n..m)` or `.get_mut(n..m)` instead
223
224 error: slicing may panic.
225   --> $DIR/indexing_slicing.rs:68:6
226    |
227 68 |     &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
228    |      ^^^^^^^^^^^^^^
229    |
230    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
231
232 error: range is out of bounds
233   --> $DIR/indexing_slicing.rs:68:6
234    |
235 68 |     &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
236    |      ^^^^^^^
237
238 error: slicing may panic.
239   --> $DIR/indexing_slicing.rs:69:6
240    |
241 69 |     &v[10..];
242    |      ^^^^^^^
243    |
244    = help: Consider using `.get(n..)` or .get_mut(n..)` instead
245
246 error: slicing may panic.
247   --> $DIR/indexing_slicing.rs:70:6
248    |
249 70 |     &v[..100];
250    |      ^^^^^^^^
251    |
252    = help: Consider using `.get(..n)`or `.get_mut(..n)` instead
253
254 error: indexing may panic.
255   --> $DIR/indexing_slicing.rs:82:5
256    |
257 82 |     v[N];
258    |     ^^^^
259    |
260    = help: Consider using `.get(n)` or `.get_mut(n)` instead
261
262 error: indexing may panic.
263   --> $DIR/indexing_slicing.rs:83:5
264    |
265 83 |     v[M];
266    |     ^^^^
267    |
268    = help: Consider using `.get(n)` or `.get_mut(n)` instead
269
270 error: aborting due to 37 previous errors
271