@@ -26,7 +26,8 @@ use rustc_session::lint::{self, Lint, LintExpectationId};
2626use rustc_span:: { Symbol , kw} ;
2727
2828use crate :: errors:: {
29- ChangeFields , IgnoredDerivedImpls , MultipleDeadCodes , ParentInfo , UselessAssignment ,
29+ ChangeFields , IgnoredDerivedImpls , MultipleDeadCodes , ParentInfo , UnusedPubItemsInBinaryNote ,
30+ UselessAssignment ,
3031} ;
3132
3233/// Any local definition that may call something in its body block should be explored. For example,
@@ -983,6 +984,13 @@ impl<'tcx> DeadVisitor<'tcx> {
983984 ( level. level , level. lint_id )
984985 }
985986
987+ fn unused_pub_items_in_binary_note ( & self ) -> Option < UnusedPubItemsInBinaryNote > {
988+ self . target_lint
989+ . name
990+ . eq ( UNUSED_PUB_ITEMS_IN_BINARY . name )
991+ . then_some ( UnusedPubItemsInBinaryNote )
992+ }
993+
986994 // # Panics
987995 // All `dead_codes` must have the same lint level, otherwise we will intentionally ICE.
988996 // This is because we emit a multi-spanned lint using the lint level of the `dead_codes`'s
@@ -1094,6 +1102,7 @@ impl<'tcx> DeadVisitor<'tcx> {
10941102 descr,
10951103 participle,
10961104 name_list,
1105+ unused_pub_items_in_binary_note : self . unused_pub_items_in_binary_note ( ) ,
10971106 change_fields_suggestion : fields_suggestion,
10981107 parent_info,
10991108 ignored_derived_impls,
@@ -1130,6 +1139,7 @@ impl<'tcx> DeadVisitor<'tcx> {
11301139 descr,
11311140 participle,
11321141 name_list,
1142+ unused_pub_items_in_binary_note : self . unused_pub_items_in_binary_note ( ) ,
11331143 parent_info,
11341144 ignored_derived_impls,
11351145 enum_variants_with_same_name,
0 commit comments