@@ -2,50 +2,39 @@ error: slicing may panic
2
2
--> $DIR/indexing_slicing_slice.rs:12:6
3
3
|
4
4
LL | &x[index..];
5
- | ^^^^^^^^^^
5
+ | ^^^^^^^^^^ help: consider using `.get(n..)` or .get_mut(n..)` instead
6
6
|
7
- = help: consider using `.get(n..)` or .get_mut(n..)` instead
8
7
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
9
8
10
9
error: slicing may panic
11
10
--> $DIR/indexing_slicing_slice.rs:13:6
12
11
|
13
12
LL | &x[..index];
14
- | ^^^^^^^^^^
15
- |
16
- = help: consider using `.get(..n)`or `.get_mut(..n)` instead
13
+ | ^^^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
17
14
18
15
error: slicing may panic
19
16
--> $DIR/indexing_slicing_slice.rs:14:6
20
17
|
21
18
LL | &x[index_from..index_to];
22
- | ^^^^^^^^^^^^^^^^^^^^^^^
23
- |
24
- = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
19
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
25
20
26
21
error: slicing may panic
27
22
--> $DIR/indexing_slicing_slice.rs:15:6
28
23
|
29
24
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
25
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
33
26
34
27
error: slicing may panic
35
28
--> $DIR/indexing_slicing_slice.rs:15:6
36
29
|
37
30
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
31
+ | ^^^^^^^^^^^^^^^ help: consider using `.get(n..)` or .get_mut(n..)` instead
41
32
42
33
error: slicing may panic
43
34
--> $DIR/indexing_slicing_slice.rs:16:6
44
35
|
45
36
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
37
+ | ^^^^^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
49
38
50
39
error: range is out of bounds
51
40
--> $DIR/indexing_slicing_slice.rs:16:8
@@ -59,17 +48,13 @@ error: slicing may panic
59
48
--> $DIR/indexing_slicing_slice.rs:17:6
60
49
|
61
50
LL | &x[0..][..3];
62
- | ^^^^^^^^^^^
63
- |
64
- = help: consider using `.get(..n)`or `.get_mut(..n)` instead
51
+ | ^^^^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
65
52
66
53
error: slicing may panic
67
54
--> $DIR/indexing_slicing_slice.rs:18:6
68
55
|
69
56
LL | &x[1..][..5];
70
- | ^^^^^^^^^^^
71
- |
72
- = help: consider using `.get(..n)`or `.get_mut(..n)` instead
57
+ | ^^^^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
73
58
74
59
error: range is out of bounds
75
60
--> $DIR/indexing_slicing_slice.rs:25:12
@@ -87,17 +72,13 @@ error: slicing may panic
87
72
--> $DIR/indexing_slicing_slice.rs:31:6
88
73
|
89
74
LL | &v[10..100];
90
- | ^^^^^^^^^^
91
- |
92
- = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
75
+ | ^^^^^^^^^^ help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
93
76
94
77
error: slicing may panic
95
78
--> $DIR/indexing_slicing_slice.rs:32:6
96
79
|
97
80
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
81
+ | ^^^^^^^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
101
82
102
83
error: range is out of bounds
103
84
--> $DIR/indexing_slicing_slice.rs:32:8
@@ -109,17 +90,13 @@ error: slicing may panic
109
90
--> $DIR/indexing_slicing_slice.rs:33:6
110
91
|
111
92
LL | &v[10..];
112
- | ^^^^^^^
113
- |
114
- = help: consider using `.get(n..)` or .get_mut(n..)` instead
93
+ | ^^^^^^^ help: consider using `.get(n..)` or .get_mut(n..)` instead
115
94
116
95
error: slicing may panic
117
96
--> $DIR/indexing_slicing_slice.rs:34:6
118
97
|
119
98
LL | &v[..100];
120
- | ^^^^^^^^
121
- |
122
- = help: consider using `.get(..n)`or `.get_mut(..n)` instead
99
+ | ^^^^^^^^ help: consider using `.get(..n)`or `.get_mut(..n)` instead
123
100
124
101
error: aborting due to 16 previous errors
125
102
0 commit comments