1
1
error: indexing into a slice multiple times without an `assert`
2
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:5 :5
2
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:6 :5
3
3
|
4
4
LL | v[0] + v[1] + v[2] + v[3] + v[4]
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
7
= help: consider asserting the length before indexing: `assert!(v.len() > 4);`
8
8
note: slice indexed here
9
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:5 :5
9
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:6 :5
10
10
|
11
11
LL | v[0] + v[1] + v[2] + v[3] + v[4]
12
12
| ^^^^
13
13
note: slice indexed here
14
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:5 :12
14
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:6 :12
15
15
|
16
16
LL | v[0] + v[1] + v[2] + v[3] + v[4]
17
17
| ^^^^
18
18
note: slice indexed here
19
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:5 :19
19
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:6 :19
20
20
|
21
21
LL | v[0] + v[1] + v[2] + v[3] + v[4]
22
22
| ^^^^
23
23
note: slice indexed here
24
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:5 :26
24
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:6 :26
25
25
|
26
26
LL | v[0] + v[1] + v[2] + v[3] + v[4]
27
27
| ^^^^
28
28
note: slice indexed here
29
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:5 :33
29
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:6 :33
30
30
|
31
31
LL | v[0] + v[1] + v[2] + v[3] + v[4]
32
32
| ^^^^
@@ -35,7 +35,7 @@ LL | v[0] + v[1] + v[2] + v[3] + v[4]
35
35
= help: to override `-D warnings` add `#[allow(clippy::missing_asserts_for_indexing)]`
36
36
37
37
error: indexing into a slice multiple times without an `assert`
38
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:10 :13
38
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:11 :13
39
39
|
40
40
LL | let _ = v[0];
41
41
| _____________^
@@ -45,19 +45,19 @@ LL | | let _ = v[1..4];
45
45
|
46
46
= help: consider asserting the length before indexing: `assert!(v.len() > 3);`
47
47
note: slice indexed here
48
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:10 :13
48
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:11 :13
49
49
|
50
50
LL | let _ = v[0];
51
51
| ^^^^
52
52
note: slice indexed here
53
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:12 :13
53
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:13 :13
54
54
|
55
55
LL | let _ = v[1..4];
56
56
| ^^^^^^^
57
57
= note: asserting the length before indexing will elide bounds checks
58
58
59
59
error: indexing into a slice multiple times without an `assert`
60
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:16 :13
60
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:17 :13
61
61
|
62
62
LL | let a = v[0];
63
63
| _____________^
@@ -68,112 +68,112 @@ LL | | let c = v[2];
68
68
|
69
69
= help: consider asserting the length before indexing: `assert!(v.len() > 2);`
70
70
note: slice indexed here
71
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:16 :13
71
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:17 :13
72
72
|
73
73
LL | let a = v[0];
74
74
| ^^^^
75
75
note: slice indexed here
76
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:18 :13
76
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:19 :13
77
77
|
78
78
LL | let b = v[1];
79
79
| ^^^^
80
80
note: slice indexed here
81
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:19 :13
81
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:20 :13
82
82
|
83
83
LL | let c = v[2];
84
84
| ^^^^
85
85
= note: asserting the length before indexing will elide bounds checks
86
86
87
87
error: indexing into a slice multiple times without an `assert`
88
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:24 :13
88
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:25 :13
89
89
|
90
90
LL | let _ = v1[0] + v1[12];
91
91
| ^^^^^^^^^^^^^^
92
92
|
93
93
= help: consider asserting the length before indexing: `assert!(v1.len() > 12);`
94
94
note: slice indexed here
95
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:24 :13
95
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:25 :13
96
96
|
97
97
LL | let _ = v1[0] + v1[12];
98
98
| ^^^^^
99
99
note: slice indexed here
100
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:24 :21
100
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:25 :21
101
101
|
102
102
LL | let _ = v1[0] + v1[12];
103
103
| ^^^^^^
104
104
= note: asserting the length before indexing will elide bounds checks
105
105
106
106
error: indexing into a slice multiple times without an `assert`
107
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:25 :13
107
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:26 :13
108
108
|
109
109
LL | let _ = v2[5] + v2[15];
110
110
| ^^^^^^^^^^^^^^
111
111
|
112
112
= help: consider asserting the length before indexing: `assert!(v2.len() > 15);`
113
113
note: slice indexed here
114
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:25 :13
114
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:26 :13
115
115
|
116
116
LL | let _ = v2[5] + v2[15];
117
117
| ^^^^^
118
118
note: slice indexed here
119
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:25 :21
119
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:26 :21
120
120
|
121
121
LL | let _ = v2[5] + v2[15];
122
122
| ^^^^^^
123
123
= note: asserting the length before indexing will elide bounds checks
124
124
125
125
error: indexing into a slice multiple times without an `assert`
126
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:31 :13
126
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:32 :13
127
127
|
128
128
LL | let _ = v2[5] + v2[15];
129
129
| ^^^^^^^^^^^^^^
130
130
|
131
131
= help: consider asserting the length before indexing: `assert!(v2.len() > 15);`
132
132
note: slice indexed here
133
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:31 :13
133
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:32 :13
134
134
|
135
135
LL | let _ = v2[5] + v2[15];
136
136
| ^^^^^
137
137
note: slice indexed here
138
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:31 :21
138
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:32 :21
139
139
|
140
140
LL | let _ = v2[5] + v2[15];
141
141
| ^^^^^^
142
142
= note: asserting the length before indexing will elide bounds checks
143
143
144
144
error: indexing into a slice multiple times without an `assert`
145
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:40 :13
145
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:41 :13
146
146
|
147
147
LL | let _ = f.v[0] + f.v[1];
148
148
| ^^^^^^^^^^^^^^^
149
149
|
150
150
= help: consider asserting the length before indexing: `assert!(f.v.len() > 1);`
151
151
note: slice indexed here
152
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:40 :13
152
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:41 :13
153
153
|
154
154
LL | let _ = f.v[0] + f.v[1];
155
155
| ^^^^^^
156
156
note: slice indexed here
157
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:40 :22
157
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:41 :22
158
158
|
159
159
LL | let _ = f.v[0] + f.v[1];
160
160
| ^^^^^^
161
161
= note: asserting the length before indexing will elide bounds checks
162
162
163
163
error: indexing into a slice multiple times without an `assert`
164
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:54 :13
164
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:55 :13
165
165
|
166
166
LL | let _ = x[0] + x[1];
167
167
| ^^^^^^^^^^^
168
168
|
169
169
= help: consider asserting the length before indexing: `assert!(x.len() > 1);`
170
170
note: slice indexed here
171
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:54 :13
171
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:55 :13
172
172
|
173
173
LL | let _ = x[0] + x[1];
174
174
| ^^^^
175
175
note: slice indexed here
176
- --> $DIR/missing_asserts_for_indexing_unfixable.rs:54 :20
176
+ --> $DIR/missing_asserts_for_indexing_unfixable.rs:55 :20
177
177
|
178
178
LL | let _ = x[0] + x[1];
179
179
| ^^^^
0 commit comments