@@ -99,6 +99,8 @@ const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
99
99
/// these and all their dependencies *must not* be in the exception list.
100
100
const RUNTIME_CRATES : & [ & str ] = & [ "std" , "core" , "alloc" , "test" , "panic_abort" , "panic_unwind" ] ;
101
101
102
+ const PERMITTED_DEPS_LOCATION : & str = concat ! ( file!( ) , ":" , line!( ) ) ;
103
+
102
104
/// Crates rustc is allowed to depend on. Avoid adding to the list if possible.
103
105
///
104
106
/// This list is here to provide a speed-bump to adding a new dependency to
@@ -500,6 +502,7 @@ fn check_permitted_dependencies(
500
502
restricted_dependency_crates : & [ & ' static str ] ,
501
503
bad : & mut bool ,
502
504
) {
505
+ let mut has_permitted_dep_error = false ;
503
506
let mut deps = HashSet :: new ( ) ;
504
507
for to_check in restricted_dependency_crates {
505
508
let to_check = pkg_from_name ( metadata, to_check) ;
@@ -534,6 +537,7 @@ fn check_permitted_dependencies(
534
537
"could not find allowed package `{permitted}`\n \
535
538
Remove from PERMITTED_DEPENDENCIES list if it is no longer used.",
536
539
) ;
540
+ has_permitted_dep_error = true ;
537
541
}
538
542
}
539
543
@@ -546,9 +550,14 @@ fn check_permitted_dependencies(
546
550
if dep. source . is_some ( ) {
547
551
if !permitted_dependencies. contains ( dep. name . as_str ( ) ) {
548
552
tidy_error ! ( bad, "Dependency for {descr} not explicitly permitted: {}" , dep. id) ;
553
+ has_permitted_dep_error = true ;
549
554
}
550
555
}
551
556
}
557
+
558
+ if has_permitted_dep_error {
559
+ eprintln ! ( "Go to `{PERMITTED_DEPS_LOCATION}` for the list." ) ;
560
+ }
552
561
}
553
562
554
563
/// Finds a package with the given name.
0 commit comments