Skip to content

Commit ce52300

Browse files
committed
disable might-panic in other tests
remove .fiexed .stderr file because `might-panic` not output error
1 parent 6dfc169 commit ce52300

9 files changed

+98
-146
lines changed

tests/ui/might_panic.fixed

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/ui/might_panic.stderr

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/ui/missing_asserts_for_indexing_unfixable.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![allow(unused)]
22
#![warn(clippy::missing_asserts_for_indexing)]
3+
#![allow(clippy::might_panic)]
34

45
fn sum(v: &[u8]) -> u8 {
56
v[0] + v[1] + v[2] + v[3] + v[4]

tests/ui/missing_asserts_for_indexing_unfixable.stderr

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
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
33
|
44
LL | v[0] + v[1] + v[2] + v[3] + v[4]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider asserting the length before indexing: `assert!(v.len() > 4);`
88
note: slice indexed here
9-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:5:5
9+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:6:5
1010
|
1111
LL | v[0] + v[1] + v[2] + v[3] + v[4]
1212
| ^^^^
1313
note: slice indexed here
14-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:5:12
14+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:6:12
1515
|
1616
LL | v[0] + v[1] + v[2] + v[3] + v[4]
1717
| ^^^^
1818
note: slice indexed here
19-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:5:19
19+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:6:19
2020
|
2121
LL | v[0] + v[1] + v[2] + v[3] + v[4]
2222
| ^^^^
2323
note: slice indexed here
24-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:5:26
24+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:6:26
2525
|
2626
LL | v[0] + v[1] + v[2] + v[3] + v[4]
2727
| ^^^^
2828
note: slice indexed here
29-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:5:33
29+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:6:33
3030
|
3131
LL | v[0] + v[1] + v[2] + v[3] + v[4]
3232
| ^^^^
@@ -35,7 +35,7 @@ LL | v[0] + v[1] + v[2] + v[3] + v[4]
3535
= help: to override `-D warnings` add `#[allow(clippy::missing_asserts_for_indexing)]`
3636

3737
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
3939
|
4040
LL | let _ = v[0];
4141
| _____________^
@@ -45,19 +45,19 @@ LL | | let _ = v[1..4];
4545
|
4646
= help: consider asserting the length before indexing: `assert!(v.len() > 3);`
4747
note: slice indexed here
48-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:10:13
48+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:11:13
4949
|
5050
LL | let _ = v[0];
5151
| ^^^^
5252
note: slice indexed here
53-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:12:13
53+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:13:13
5454
|
5555
LL | let _ = v[1..4];
5656
| ^^^^^^^
5757
= note: asserting the length before indexing will elide bounds checks
5858

5959
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
6161
|
6262
LL | let a = v[0];
6363
| _____________^
@@ -68,112 +68,112 @@ LL | | let c = v[2];
6868
|
6969
= help: consider asserting the length before indexing: `assert!(v.len() > 2);`
7070
note: slice indexed here
71-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:16:13
71+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:17:13
7272
|
7373
LL | let a = v[0];
7474
| ^^^^
7575
note: slice indexed here
76-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:18:13
76+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:19:13
7777
|
7878
LL | let b = v[1];
7979
| ^^^^
8080
note: slice indexed here
81-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:19:13
81+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:20:13
8282
|
8383
LL | let c = v[2];
8484
| ^^^^
8585
= note: asserting the length before indexing will elide bounds checks
8686

8787
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
8989
|
9090
LL | let _ = v1[0] + v1[12];
9191
| ^^^^^^^^^^^^^^
9292
|
9393
= help: consider asserting the length before indexing: `assert!(v1.len() > 12);`
9494
note: slice indexed here
95-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:24:13
95+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:25:13
9696
|
9797
LL | let _ = v1[0] + v1[12];
9898
| ^^^^^
9999
note: slice indexed here
100-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:24:21
100+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:25:21
101101
|
102102
LL | let _ = v1[0] + v1[12];
103103
| ^^^^^^
104104
= note: asserting the length before indexing will elide bounds checks
105105

106106
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
108108
|
109109
LL | let _ = v2[5] + v2[15];
110110
| ^^^^^^^^^^^^^^
111111
|
112112
= help: consider asserting the length before indexing: `assert!(v2.len() > 15);`
113113
note: slice indexed here
114-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:25:13
114+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:26:13
115115
|
116116
LL | let _ = v2[5] + v2[15];
117117
| ^^^^^
118118
note: slice indexed here
119-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:25:21
119+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:26:21
120120
|
121121
LL | let _ = v2[5] + v2[15];
122122
| ^^^^^^
123123
= note: asserting the length before indexing will elide bounds checks
124124

125125
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
127127
|
128128
LL | let _ = v2[5] + v2[15];
129129
| ^^^^^^^^^^^^^^
130130
|
131131
= help: consider asserting the length before indexing: `assert!(v2.len() > 15);`
132132
note: slice indexed here
133-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:31:13
133+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:32:13
134134
|
135135
LL | let _ = v2[5] + v2[15];
136136
| ^^^^^
137137
note: slice indexed here
138-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:31:21
138+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:32:21
139139
|
140140
LL | let _ = v2[5] + v2[15];
141141
| ^^^^^^
142142
= note: asserting the length before indexing will elide bounds checks
143143

144144
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
146146
|
147147
LL | let _ = f.v[0] + f.v[1];
148148
| ^^^^^^^^^^^^^^^
149149
|
150150
= help: consider asserting the length before indexing: `assert!(f.v.len() > 1);`
151151
note: slice indexed here
152-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:40:13
152+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:41:13
153153
|
154154
LL | let _ = f.v[0] + f.v[1];
155155
| ^^^^^^
156156
note: slice indexed here
157-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:40:22
157+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:41:22
158158
|
159159
LL | let _ = f.v[0] + f.v[1];
160160
| ^^^^^^
161161
= note: asserting the length before indexing will elide bounds checks
162162

163163
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
165165
|
166166
LL | let _ = x[0] + x[1];
167167
| ^^^^^^^^^^^
168168
|
169169
= help: consider asserting the length before indexing: `assert!(x.len() > 1);`
170170
note: slice indexed here
171-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:54:13
171+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:55:13
172172
|
173173
LL | let _ = x[0] + x[1];
174174
| ^^^^
175175
note: slice indexed here
176-
--> $DIR/missing_asserts_for_indexing_unfixable.rs:54:20
176+
--> $DIR/missing_asserts_for_indexing_unfixable.rs:55:20
177177
|
178178
LL | let _ = x[0] + x[1];
179179
| ^^^^

tests/ui/shadow.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
clippy::let_unit_value,
66
clippy::needless_if,
77
clippy::redundant_guards,
8-
clippy::redundant_locals
8+
clippy::redundant_locals,
9+
clippy::might_panic
910
)]
1011

1112
extern crate proc_macro_derive;

0 commit comments

Comments
 (0)