@@ -593,7 +593,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
593
593
let lint = UnknownLintFromCommandLine { name, suggestion, requested_level } ;
594
594
self . emit_lint ( UNKNOWN_LINTS , lint) ;
595
595
}
596
- CheckLintNameResult :: Tool ( Err ( ( Some ( _ ) , ref replace) ) ) => {
596
+ CheckLintNameResult :: Tool ( _ , Some ( ref replace) ) => {
597
597
let name = lint_name. clone ( ) ;
598
598
let requested_level = RequestedLevel { level, lint_name } ;
599
599
let lint = DeprecatedLintNameFromCommandLine { name, replace, requested_level } ;
@@ -902,62 +902,52 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
902
902
}
903
903
}
904
904
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 => {
908
908
let complete_name =
909
909
& format ! ( "{}::{}" , tool_ident. unwrap( ) . name, name) ;
910
- let src = LintLevelSource :: Node {
910
+ LintLevelSource :: Node {
911
911
name : Symbol :: intern ( complete_name) ,
912
912
span : sp,
913
913
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
- ) ;
925
914
}
926
915
}
927
- Err ( ( Some ( ids) , ref new_lint_name) ) => {
928
- let lint = builtin:: RENAMED_AND_REMOVED_LINTS ;
916
+ Some ( new_lint_name) => {
929
917
self . emit_span_lint (
930
- lint ,
918
+ builtin :: RENAMED_AND_REMOVED_LINTS ,
931
919
sp. into ( ) ,
932
920
DeprecatedLintName {
933
921
name,
934
922
suggestion : sp,
935
923
replace : new_lint_name,
936
924
} ,
937
925
) ;
938
-
939
- let src = LintLevelSource :: Node {
926
+ LintLevelSource :: Node {
940
927
name : Symbol :: intern ( new_lint_name) ,
941
928
span : sp,
942
929
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
- ) ;
952
930
}
953
931
}
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) ) ;
959
936
}
960
937
}
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.
961
951
}
962
952
963
953
& CheckLintNameResult :: NoTool => {
0 commit comments