]> git.lizzy.rs Git - rust.git/blob - tests/ui/indexing_slicing_slice.stderr
Fix #88256, remove duplicated diagnostic
[rust.git] / tests / ui / indexing_slicing_slice.stderr
1 error: slicing may panic
2   --> $DIR/indexing_slicing_slice.rs:12:6
3    |
4 LL |     &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_slice.rs:13:6
12    |
13 LL |     &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_slice.rs:14:6
20    |
21 LL |     &x[index_from..index_to];
22    |      ^^^^^^^^^^^^^^^^^^^^^^^
23    |
24    = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
25
26 error: slicing may panic
27   --> $DIR/indexing_slicing_slice.rs:15:6
28    |
29 LL |     &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
30    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
31    |
32    = help: consider using `.get(..n)`or `.get_mut(..n)` instead
33
34 error: slicing may panic
35   --> $DIR/indexing_slicing_slice.rs:15:6
36    |
37 LL |     &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_slice.rs:16:6
44    |
45 LL |     &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
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_slice.rs:16:8
52    |
53 LL |     &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
54    |        ^
55    |
56    = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
57
58 error: slicing may panic
59   --> $DIR/indexing_slicing_slice.rs:17:6
60    |
61 LL |     &x[0..][..3];
62    |      ^^^^^^^^^^^
63    |
64    = help: consider using `.get(..n)`or `.get_mut(..n)` instead
65
66 error: slicing may panic
67   --> $DIR/indexing_slicing_slice.rs:18:6
68    |
69 LL |     &x[1..][..5];
70    |      ^^^^^^^^^^^
71    |
72    = help: consider using `.get(..n)`or `.get_mut(..n)` instead
73
74 error: range is out of bounds
75   --> $DIR/indexing_slicing_slice.rs:25:12
76    |
77 LL |     &y[0..=4];
78    |            ^
79
80 error: range is out of bounds
81   --> $DIR/indexing_slicing_slice.rs:26:11
82    |
83 LL |     &y[..=4];
84    |           ^
85
86 error: slicing may panic
87   --> $DIR/indexing_slicing_slice.rs:31:6
88    |
89 LL |     &v[10..100];
90    |      ^^^^^^^^^^
91    |
92    = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
93
94 error: slicing may panic
95   --> $DIR/indexing_slicing_slice.rs:32:6
96    |
97 LL |     &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
98    |      ^^^^^^^^^^^^^^
99    |
100    = help: consider using `.get(..n)`or `.get_mut(..n)` instead
101
102 error: range is out of bounds
103   --> $DIR/indexing_slicing_slice.rs:32:8
104    |
105 LL |     &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
106    |        ^^
107
108 error: slicing may panic
109   --> $DIR/indexing_slicing_slice.rs:33:6
110    |
111 LL |     &v[10..];
112    |      ^^^^^^^
113    |
114    = help: consider using `.get(n..)` or .get_mut(n..)` instead
115
116 error: slicing may panic
117   --> $DIR/indexing_slicing_slice.rs:34:6
118    |
119 LL |     &v[..100];
120    |      ^^^^^^^^
121    |
122    = help: consider using `.get(..n)`or `.get_mut(..n)` instead
123
124 error: aborting due to 16 previous errors
125