@@ -591,7 +591,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
591
591
let lint = UnknownLintFromCommandLine { name, suggestion, requested_level } ;
592
592
self . emit_lint ( UNKNOWN_LINTS , lint) ;
593
593
}
594
- CheckLintNameResult :: Tool ( Err ( ( Some ( _ ) , ref replace) ) ) => {
594
+ CheckLintNameResult :: Tool ( _ , Some ( ref replace) ) => {
595
595
let name = lint_name. clone ( ) ;
596
596
let requested_level = RequestedLevel { level, lint_name } ;
597
597
let lint = DeprecatedLintNameFromCommandLine { name, replace, requested_level } ;
@@ -900,62 +900,55 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
900
900
}
901
901
}
902
902
903
- CheckLintNameResult :: Tool ( result ) => {
904
- match * result {
905
- Ok ( ids ) => {
903
+ CheckLintNameResult :: Tool ( ids , new_lint_name ) => {
904
+ match new_lint_name {
905
+ None => {
906
906
let complete_name =
907
907
& format ! ( "{}::{}" , tool_ident. unwrap( ) . name, name) ;
908
908
let src = LintLevelSource :: Node {
909
909
name : Symbol :: intern ( complete_name) ,
910
910
span : sp,
911
911
reason,
912
912
} ;
913
- for & id in ids {
913
+ for & id in * ids {
914
914
if self . check_gated_lint ( id, attr. span , false ) {
915
915
self . insert_spec ( id, ( level, src) ) ;
916
916
}
917
917
}
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
- }
924
918
}
925
- Err ( ( Some ( ids) , ref new_lint_name) ) => {
926
- let lint = builtin:: RENAMED_AND_REMOVED_LINTS ;
919
+ Some ( new_lint_name) => {
927
920
self . emit_span_lint (
928
- lint ,
921
+ builtin :: RENAMED_AND_REMOVED_LINTS ,
929
922
sp. into ( ) ,
930
923
DeprecatedLintName {
931
924
name,
932
925
suggestion : sp,
933
926
replace : new_lint_name,
934
927
} ,
935
928
) ;
936
-
937
929
let src = LintLevelSource :: Node {
938
930
name : Symbol :: intern ( new_lint_name) ,
939
931
span : sp,
940
932
reason,
941
933
} ;
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) ) ;
950
936
}
951
937
}
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
- }
958
938
}
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.
959
952
}
960
953
961
954
& CheckLintNameResult :: NoTool => {
0 commit comments