@@ -593,7 +593,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
593593 let lint = UnknownLintFromCommandLine { name, suggestion, requested_level } ;
594594 self . emit_lint ( UNKNOWN_LINTS , lint) ;
595595 }
596- CheckLintNameResult :: Tool ( Err ( ( Some ( _ ) , ref replace) ) ) => {
596+ CheckLintNameResult :: Tool ( _ , Some ( ref replace) ) => {
597597 let name = lint_name. clone ( ) ;
598598 let requested_level = RequestedLevel { level, lint_name } ;
599599 let lint = DeprecatedLintNameFromCommandLine { name, replace, requested_level } ;
@@ -902,62 +902,52 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
902902 }
903903 }
904904
905- CheckLintNameResult :: Tool ( result ) => {
906- match * result {
907- Ok ( ids ) => {
905+ CheckLintNameResult :: Tool ( ids , new_lint_name ) => {
906+ let src = match new_lint_name {
907+ None => {
908908 let complete_name =
909909 & format ! ( "{}::{}" , tool_ident. unwrap( ) . name, name) ;
910- let src = LintLevelSource :: Node {
910+ LintLevelSource :: Node {
911911 name : Symbol :: intern ( complete_name) ,
912912 span : sp,
913913 reason,
914- } ;
915- for & id in ids {
916- if self . check_gated_lint ( id, attr. span , false ) {
917- self . insert_spec ( id, ( level, src) ) ;
918- }
919- }
920- if let Level :: Expect ( expect_id) = level {
921- self . provider . push_expectation (
922- expect_id,
923- LintExpectation :: new ( reason, sp, false , tool_name) ,
924- ) ;
925914 }
926915 }
927- Err ( ( Some ( ids) , ref new_lint_name) ) => {
928- let lint = builtin:: RENAMED_AND_REMOVED_LINTS ;
916+ Some ( new_lint_name) => {
929917 self . emit_span_lint (
930- lint ,
918+ builtin :: RENAMED_AND_REMOVED_LINTS ,
931919 sp. into ( ) ,
932920 DeprecatedLintName {
933921 name,
934922 suggestion : sp,
935923 replace : new_lint_name,
936924 } ,
937925 ) ;
938-
939- let src = LintLevelSource :: Node {
926+ LintLevelSource :: Node {
940927 name : Symbol :: intern ( new_lint_name) ,
941928 span : sp,
942929 reason,
943- } ;
944- for id in ids {
945- self . insert_spec ( * id, ( level, src) ) ;
946- }
947- if let Level :: Expect ( expect_id) = level {
948- self . provider . push_expectation (
949- expect_id,
950- LintExpectation :: new ( reason, sp, false , tool_name) ,
951- ) ;
952930 }
953931 }
954- Err ( ( None , _) ) => {
955- // If Tool(Err(None, _)) is returned, then either the lint does not
956- // exist in the tool or the code was not compiled with the tool and
957- // therefore the lint was never added to the `LintStore`. To detect
958- // this is the responsibility of the lint tool.
932+ } ;
933+ for & id in * ids {
934+ if self . check_gated_lint ( id, attr. span , false ) {
935+ self . insert_spec ( id, ( level, src) ) ;
959936 }
960937 }
938+ if let Level :: Expect ( expect_id) = level {
939+ self . provider . push_expectation (
940+ expect_id,
941+ LintExpectation :: new ( reason, sp, false , tool_name) ,
942+ ) ;
943+ }
944+ }
945+
946+ CheckLintNameResult :: MissingTool => {
947+ // If `MissingTool` is returned, then either the lint does not
948+ // exist in the tool or the code was not compiled with the tool and
949+ // therefore the lint was never added to the `LintStore`. To detect
950+ // this is the responsibility of the lint tool.
961951 }
962952
963953 & CheckLintNameResult :: NoTool => {
0 commit comments