@@ -26,18 +26,14 @@ const EXCEPTIONS: &[&str] = &[
26
26
"openssl" , // BSD+advertising clause, cargo, mdbook
27
27
"pest" , // MPL2, mdbook via handlebars
28
28
"arrayref" , // BSD-2-Clause, mdbook via handlebars via pest
29
- "thread-id" , // Apache-2.0, mdbook
30
29
"toml-query" , // MPL-2.0, mdbook
31
30
"toml-query_derive" , // MPL-2.0, mdbook
32
31
"is-match" , // MPL-2.0, mdbook
33
- "cssparser" , // MPL-2.0, rustdoc
34
32
"smallvec" , // MPL-2.0, rustdoc
35
33
"rdrand" , // ISC, mdbook, rustfmt
36
34
"fuchsia-cprng" , // BSD-3-Clause, mdbook, rustfmt
37
35
"fuchsia-zircon-sys" , // BSD-3-Clause, rustdoc, rustc, cargo
38
36
"fuchsia-zircon" , // BSD-3-Clause, rustdoc, rustc, cargo (jobserver & tempdir)
39
- "cssparser-macros" , // MPL-2.0, rustdoc
40
- "selectors" , // MPL-2.0, rustdoc
41
37
"clippy_lints" , // MPL-2.0, rls
42
38
"colored" , // MPL-2.0, rustfmt
43
39
"ordslice" , // Apache-2.0, rls
@@ -74,7 +70,6 @@ const WHITELIST: &[&str] = &[
74
70
"backtrace" ,
75
71
"backtrace-sys" ,
76
72
"bitflags" ,
77
- "build_const" ,
78
73
"byteorder" ,
79
74
"c2-chacha" ,
80
75
"cc" ,
@@ -84,7 +79,6 @@ const WHITELIST: &[&str] = &[
84
79
"cloudabi" ,
85
80
"cmake" ,
86
81
"compiler_builtins" ,
87
- "crc" ,
88
82
"crc32fast" ,
89
83
"crossbeam-deque" ,
90
84
"crossbeam-epoch" ,
@@ -118,12 +112,9 @@ const WHITELIST: &[&str] = &[
118
112
"memchr" ,
119
113
"memmap" ,
120
114
"memoffset" ,
121
- "miniz-sys" ,
122
115
"miniz_oxide" ,
123
- "miniz_oxide_c_api" ,
124
116
"nodrop" ,
125
117
"num_cpus" ,
126
- "owning_ref" ,
127
118
"parking_lot" ,
128
119
"parking_lot_core" ,
129
120
"pkg-config" ,
@@ -162,7 +153,6 @@ const WHITELIST: &[&str] = &[
162
153
"synstructure" ,
163
154
"tempfile" ,
164
155
"termcolor" ,
165
- "terminon" ,
166
156
"termion" ,
167
157
"termize" ,
168
158
"thread_local" ,
@@ -172,11 +162,9 @@ const WHITELIST: &[&str] = &[
172
162
"unicode-security" ,
173
163
"unicode-width" ,
174
164
"unicode-xid" ,
175
- "unreachable" ,
176
165
"utf8-ranges" ,
177
166
"vcpkg" ,
178
167
"version_check" ,
179
- "void" ,
180
168
"wasi" ,
181
169
"winapi" ,
182
170
"winapi-build" ,
@@ -205,6 +193,18 @@ pub fn check(path: &Path, cargo: &Path, bad: &mut bool) {
205
193
///
206
194
/// Packages listed in `EXCEPTIONS` are allowed for tools.
207
195
fn check_exceptions ( metadata : & Metadata , bad : & mut bool ) {
196
+ // Check that the EXCEPTIONS list does not have unused entries.
197
+ for exception in EXCEPTIONS {
198
+ if !metadata. packages . iter ( ) . any ( |p| p. name == * exception) {
199
+ println ! (
200
+ "could not find exception package `{}`\n \
201
+ Remove from EXCEPTIONS list if it is no longer used.",
202
+ exception
203
+ ) ;
204
+ * bad = true ;
205
+ }
206
+ }
207
+ // Check if any package does not have a valid license.
208
208
for pkg in & metadata. packages {
209
209
if pkg. source . is_none ( ) {
210
210
// No need to check local packages.
@@ -233,6 +233,17 @@ fn check_exceptions(metadata: &Metadata, bad: &mut bool) {
233
233
///
234
234
/// Specifically, this checks that the dependencies are on the `WHITELIST`.
235
235
fn check_whitelist ( metadata : & Metadata , bad : & mut bool ) {
236
+ // Check that the WHITELIST does not have unused entries.
237
+ for name in WHITELIST {
238
+ if !metadata. packages . iter ( ) . any ( |p| p. name == * name) {
239
+ println ! (
240
+ "could not find whitelisted package `{}`\n \
241
+ Remove from WHITELIST list if it is no longer used.",
242
+ name
243
+ ) ;
244
+ * bad = true ;
245
+ }
246
+ }
236
247
// Get the whitelist in a convenient form.
237
248
let whitelist: HashSet < _ > = WHITELIST . iter ( ) . cloned ( ) . collect ( ) ;
238
249
0 commit comments