@@ -33,7 +33,6 @@ use crate::{
3333 BuiltinMutablesTransmutes , BuiltinNoMangleGeneric , BuiltinNonShorthandFieldPatterns ,
3434 BuiltinSpecialModuleNameUsed , BuiltinTrivialBounds , BuiltinTypeAliasGenericBounds ,
3535 BuiltinTypeAliasGenericBoundsSuggestion , BuiltinTypeAliasWhereClause ,
36- BuiltinUnexpectedCliConfigName , BuiltinUnexpectedCliConfigValue ,
3736 BuiltinUngatedAsyncFnTrackCaller , BuiltinUnpermittedTypeInit ,
3837 BuiltinUnpermittedTypeInitSub , BuiltinUnreachablePub , BuiltinUnsafe ,
3938 BuiltinUnstableFeatures , BuiltinUnusedDocComment , BuiltinUnusedDocCommentSub ,
@@ -60,7 +59,6 @@ use rustc_middle::ty::GenericArgKind;
6059use rustc_middle:: ty:: ToPredicate ;
6160use rustc_middle:: ty:: TypeVisitableExt ;
6261use rustc_middle:: ty:: { self , Ty , TyCtxt , VariantDef } ;
63- use rustc_session:: config:: ExpectedValues ;
6462use rustc_session:: lint:: { BuiltinLintDiagnostics , FutureIncompatibilityReason } ;
6563use rustc_span:: edition:: Edition ;
6664use rustc_span:: source_map:: Spanned ;
@@ -2889,26 +2887,3 @@ impl EarlyLintPass for SpecialModuleName {
28892887 }
28902888 }
28912889}
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