@@ -99,6 +99,8 @@ const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
9999/// these and all their dependencies *must not* be in the exception list.
100100const RUNTIME_CRATES : & [ & str ] = & [ "std" , "core" , "alloc" , "test" , "panic_abort" , "panic_unwind" ] ;
101101
102+ const PERMITTED_DEPS_LOCATION : & str = concat ! ( file!( ) , ":" , line!( ) ) ;
103+
102104/// Crates rustc is allowed to depend on. Avoid adding to the list if possible.
103105///
104106/// This list is here to provide a speed-bump to adding a new dependency to
@@ -500,6 +502,7 @@ fn check_permitted_dependencies(
500502 restricted_dependency_crates : & [ & ' static str ] ,
501503 bad : & mut bool ,
502504) {
505+ let mut has_permitted_dep_error = false ;
503506 let mut deps = HashSet :: new ( ) ;
504507 for to_check in restricted_dependency_crates {
505508 let to_check = pkg_from_name ( metadata, to_check) ;
@@ -534,6 +537,7 @@ fn check_permitted_dependencies(
534537 "could not find allowed package `{permitted}`\n \
535538 Remove from PERMITTED_DEPENDENCIES list if it is no longer used.",
536539 ) ;
540+ has_permitted_dep_error = true ;
537541 }
538542 }
539543
@@ -546,9 +550,14 @@ fn check_permitted_dependencies(
546550 if dep. source . is_some ( ) {
547551 if !permitted_dependencies. contains ( dep. name . as_str ( ) ) {
548552 tidy_error ! ( bad, "Dependency for {descr} not explicitly permitted: {}" , dep. id) ;
553+ has_permitted_dep_error = true ;
549554 }
550555 }
551556 }
557+
558+ if has_permitted_dep_error {
559+ eprintln ! ( "Go to `{PERMITTED_DEPS_LOCATION}` for the list." ) ;
560+ }
552561}
553562
554563/// Finds a package with the given name.
0 commit comments