@@ -33,7 +33,6 @@ use crate::{
33
33
BuiltinMutablesTransmutes , BuiltinNoMangleGeneric , BuiltinNonShorthandFieldPatterns ,
34
34
BuiltinSpecialModuleNameUsed , BuiltinTrivialBounds , BuiltinTypeAliasGenericBounds ,
35
35
BuiltinTypeAliasGenericBoundsSuggestion , BuiltinTypeAliasWhereClause ,
36
- BuiltinUnexpectedCliConfigName , BuiltinUnexpectedCliConfigValue ,
37
36
BuiltinUngatedAsyncFnTrackCaller , BuiltinUnpermittedTypeInit ,
38
37
BuiltinUnpermittedTypeInitSub , BuiltinUnreachablePub , BuiltinUnsafe ,
39
38
BuiltinUnstableFeatures , BuiltinUnusedDocComment , BuiltinUnusedDocCommentSub ,
@@ -60,7 +59,6 @@ use rustc_middle::ty::GenericArgKind;
60
59
use rustc_middle:: ty:: ToPredicate ;
61
60
use rustc_middle:: ty:: TypeVisitableExt ;
62
61
use rustc_middle:: ty:: { self , Ty , TyCtxt , VariantDef } ;
63
- use rustc_session:: config:: ExpectedValues ;
64
62
use rustc_session:: lint:: { BuiltinLintDiagnostics , FutureIncompatibilityReason } ;
65
63
use rustc_span:: edition:: Edition ;
66
64
use rustc_span:: source_map:: Spanned ;
@@ -2889,26 +2887,3 @@ impl EarlyLintPass for SpecialModuleName {
2889
2887
}
2890
2888
}
2891
2889
}
2892
-
2893
- pub use rustc_session:: lint:: builtin:: UNEXPECTED_CFGS ;
2894
-
2895
- declare_lint_pass ! ( UnexpectedCfgs => [ UNEXPECTED_CFGS ] ) ;
2896
-
2897
- impl EarlyLintPass for UnexpectedCfgs {
2898
- fn check_crate ( & mut self , cx : & EarlyContext < ' _ > , _: & ast:: Crate ) {
2899
- let cfg = & cx. sess ( ) . parse_sess . config ;
2900
- let check_cfg = & cx. sess ( ) . parse_sess . check_config ;
2901
- for & ( name, value) in cfg {
2902
- match check_cfg. expecteds . get ( & name) {
2903
- Some ( ExpectedValues :: Some ( values) ) if !values. contains ( & value) => {
2904
- let value = value. unwrap_or ( kw:: Empty ) ;
2905
- cx. emit_lint ( UNEXPECTED_CFGS , BuiltinUnexpectedCliConfigValue { name, value } ) ;
2906
- }
2907
- None if check_cfg. exhaustive_names => {
2908
- cx. emit_lint ( UNEXPECTED_CFGS , BuiltinUnexpectedCliConfigName { name } ) ;
2909
- }
2910
- _ => { /* expected */ }
2911
- }
2912
- }
2913
- }
2914
- }
0 commit comments