@@ -591,7 +591,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
591591 let lint = UnknownLintFromCommandLine { name, suggestion, requested_level } ;
592592 self . emit_lint ( UNKNOWN_LINTS , lint) ;
593593 }
594- CheckLintNameResult :: Tool ( Err ( ( Some ( _ ) , ref replace) ) ) => {
594+ CheckLintNameResult :: Tool ( _ , Some ( ref replace) ) => {
595595 let name = lint_name. clone ( ) ;
596596 let requested_level = RequestedLevel { level, lint_name } ;
597597 let lint = DeprecatedLintNameFromCommandLine { name, replace, requested_level } ;
@@ -900,62 +900,55 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
900900 }
901901 }
902902
903- CheckLintNameResult :: Tool ( result ) => {
904- match * result {
905- Ok ( ids ) => {
903+ CheckLintNameResult :: Tool ( ids , new_lint_name ) => {
904+ match new_lint_name {
905+ None => {
906906 let complete_name =
907907 & format ! ( "{}::{}" , tool_ident. unwrap( ) . name, name) ;
908908 let src = LintLevelSource :: Node {
909909 name : Symbol :: intern ( complete_name) ,
910910 span : sp,
911911 reason,
912912 } ;
913- for & id in ids {
913+ for & id in * ids {
914914 if self . check_gated_lint ( id, attr. span , false ) {
915915 self . insert_spec ( id, ( level, src) ) ;
916916 }
917917 }
918- if let Level :: Expect ( expect_id) = level {
919- self . provider . push_expectation (
920- expect_id,
921- LintExpectation :: new ( reason, sp, false , tool_name) ,
922- ) ;
923- }
924918 }
925- Err ( ( Some ( ids) , ref new_lint_name) ) => {
926- let lint = builtin:: RENAMED_AND_REMOVED_LINTS ;
919+ Some ( new_lint_name) => {
927920 self . emit_span_lint (
928- lint ,
921+ builtin :: RENAMED_AND_REMOVED_LINTS ,
929922 sp. into ( ) ,
930923 DeprecatedLintName {
931924 name,
932925 suggestion : sp,
933926 replace : new_lint_name,
934927 } ,
935928 ) ;
936-
937929 let src = LintLevelSource :: Node {
938930 name : Symbol :: intern ( new_lint_name) ,
939931 span : sp,
940932 reason,
941933 } ;
942- for id in ids {
943- self . insert_spec ( * id, ( level, src) ) ;
944- }
945- if let Level :: Expect ( expect_id) = level {
946- self . provider . push_expectation (
947- expect_id,
948- LintExpectation :: new ( reason, sp, false , tool_name) ,
949- ) ;
934+ for & id in * ids {
935+ self . insert_spec ( id, ( level, src) ) ;
950936 }
951937 }
952- Err ( ( None , _) ) => {
953- // If Tool(Err(None, _)) is returned, then either the lint does not
954- // exist in the tool or the code was not compiled with the tool and
955- // therefore the lint was never added to the `LintStore`. To detect
956- // this is the responsibility of the lint tool.
957- }
958938 }
939+ if let Level :: Expect ( expect_id) = level {
940+ self . provider . push_expectation (
941+ expect_id,
942+ LintExpectation :: new ( reason, sp, false , tool_name) ,
943+ ) ;
944+ }
945+ }
946+
947+ CheckLintNameResult :: MissingTool => {
948+ // If `MissingTool` is returned, then either the lint does not
949+ // exist in the tool or the code was not compiled with the tool and
950+ // therefore the lint was never added to the `LintStore`. To detect
951+ // this is the responsibility of the lint tool.
959952 }
960953
961954 & CheckLintNameResult :: NoTool => {
0 commit comments