@@ -73,14 +73,11 @@ const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
7373/// these and all their dependencies *must not* be in the exception list.
7474const RUNTIME_CRATES : & [ & str ] = & [ "std" , "core" , "alloc" , "test" , "panic_abort" , "panic_unwind" ] ;
7575
76- /// Crates whose dependencies must be explicitly permitted.
77- const RESTRICTED_DEPENDENCY_CRATES : & [ & str ] = & [ "rustc_driver" , "rustc_codegen_llvm" ] ;
78-
7976/// Crates rustc is allowed to depend on. Avoid adding to the list if possible.
8077///
8178/// This list is here to provide a speed-bump to adding a new dependency to
8279/// rustc. Please check with the compiler team before adding an entry.
83- const PERMITTED_DEPENDENCIES : & [ & str ] = & [
80+ const PERMITTED_RUSTC_DEPENDENCIES : & [ & str ] = & [
8481 "addr2line" ,
8582 "adler" ,
8683 "ahash" ,
@@ -307,7 +304,7 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
307304] ;
308305
309306const FORBIDDEN_TO_HAVE_DUPLICATES : & [ & str ] = & [
310- // These two crates take quite a long time to build, so don't allow two versions of them
307+ // This crate takes quite a long time to build, so don't allow two versions of them
311308 // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times
312309 // under control.
313310 "cargo" ,
@@ -324,12 +321,12 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
324321 . features ( cargo_metadata:: CargoOpt :: AllFeatures ) ;
325322 let metadata = t ! ( cmd. exec( ) ) ;
326323 let runtime_ids = compute_runtime_crates ( & metadata) ;
327- check_exceptions ( & metadata, EXCEPTIONS , runtime_ids, bad) ;
328- check_dependencies (
324+ check_license_exceptions ( & metadata, EXCEPTIONS , runtime_ids, bad) ;
325+ check_permitted_dependencies (
329326 & metadata,
330327 "rustc" ,
331- PERMITTED_DEPENDENCIES ,
332- RESTRICTED_DEPENDENCY_CRATES ,
328+ PERMITTED_RUSTC_DEPENDENCIES ,
329+ & [ "rustc_driver" , "rustc_codegen_llvm" ] ,
333330 bad,
334331 ) ;
335332 check_crate_duplicate ( & metadata, FORBIDDEN_TO_HAVE_DUPLICATES , bad) ;
@@ -342,8 +339,8 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
342339 . features ( cargo_metadata:: CargoOpt :: AllFeatures ) ;
343340 let metadata = t ! ( cmd. exec( ) ) ;
344341 let runtime_ids = HashSet :: new ( ) ;
345- check_exceptions ( & metadata, EXCEPTIONS_CRANELIFT , runtime_ids, bad) ;
346- check_dependencies (
342+ check_license_exceptions ( & metadata, EXCEPTIONS_CRANELIFT , runtime_ids, bad) ;
343+ check_permitted_dependencies (
347344 & metadata,
348345 "cranelift" ,
349346 PERMITTED_CRANELIFT_DEPENDENCIES ,
@@ -358,13 +355,13 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
358355 . features ( cargo_metadata:: CargoOpt :: AllFeatures ) ;
359356 let metadata = t ! ( cmd. exec( ) ) ;
360357 let runtime_ids = HashSet :: new ( ) ;
361- check_exceptions ( & metadata, EXCEPTIONS_BOOTSTRAP , runtime_ids, bad) ;
358+ check_license_exceptions ( & metadata, EXCEPTIONS_BOOTSTRAP , runtime_ids, bad) ;
362359}
363360
364361/// Check that all licenses are in the valid list in `LICENSES`.
365362///
366- /// Packages listed in `EXCEPTIONS ` are allowed for tools.
367- fn check_exceptions (
363+ /// Packages listed in `exceptions ` are allowed for tools.
364+ fn check_license_exceptions (
368365 metadata : & Metadata ,
369366 exceptions : & [ ( & str , & str ) ] ,
370367 runtime_ids : HashSet < & PackageId > ,
@@ -434,11 +431,11 @@ fn check_exceptions(
434431 }
435432}
436433
437- /// Checks the dependency of `RESTRICTED_DEPENDENCY_CRATES ` at the given path. Changes `bad` to
434+ /// Checks the dependency of `restricted_dependency_crates ` at the given path. Changes `bad` to
438435/// `true` if a check failed.
439436///
440- /// Specifically, this checks that the dependencies are on the `PERMITTED_DEPENDENCIES `.
441- fn check_dependencies (
437+ /// Specifically, this checks that the dependencies are on the `permitted_dependencies `.
438+ fn check_permitted_dependencies (
442439 metadata : & Metadata ,
443440 descr : & str ,
444441 permitted_dependencies : & [ & ' static str ] ,
0 commit comments