@@ -22,7 +22,7 @@ use rustc_ast::visit::{FnCtxt, FnKind};
2222use rustc_ast:: { self as ast, * } ;
2323use rustc_ast_pretty:: pprust:: expr_to_string;
2424use rustc_errors:: { Applicability , LintDiagnostic } ;
25- use rustc_feature:: { AttributeGate , BuiltinAttribute , GateIssue , Stability , deprecated_attributes } ;
25+ use rustc_feature:: GateIssue ;
2626use rustc_hir as hir;
2727use rustc_hir:: def:: { DefKind , Res } ;
2828use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId , LocalDefId } ;
@@ -48,8 +48,7 @@ use rustc_trait_selection::traits::{self};
4848
4949use crate :: errors:: BuiltinEllipsisInclusiveRangePatterns ;
5050use crate :: lints:: {
51- BuiltinAnonymousParams , BuiltinConstNoMangle , BuiltinDeprecatedAttrLink ,
52- BuiltinDeprecatedAttrLinkSuggestion , BuiltinDerefNullptr , BuiltinDoubleNegations ,
51+ BuiltinAnonymousParams , BuiltinConstNoMangle , BuiltinDerefNullptr , BuiltinDoubleNegations ,
5352 BuiltinDoubleNegationsAddParens , BuiltinEllipsisInclusiveRangePatternsLint ,
5453 BuiltinExplicitOutlives , BuiltinExplicitOutlivesSuggestion , BuiltinFeatureIssueNote ,
5554 BuiltinIncompleteFeatures , BuiltinIncompleteFeaturesHelp , BuiltinInternalFeatures ,
@@ -798,50 +797,6 @@ impl EarlyLintPass for AnonymousParameters {
798797 }
799798}
800799
801- /// Check for use of attributes which have been deprecated.
802- #[ derive( Clone ) ]
803- pub struct DeprecatedAttr {
804- // This is not free to compute, so we want to keep it around, rather than
805- // compute it for every attribute.
806- depr_attrs : Vec < & ' static BuiltinAttribute > ,
807- }
808-
809- impl_lint_pass ! ( DeprecatedAttr => [ ] ) ;
810-
811- impl Default for DeprecatedAttr {
812- fn default ( ) -> Self {
813- DeprecatedAttr { depr_attrs : deprecated_attributes ( ) }
814- }
815- }
816-
817- impl EarlyLintPass for DeprecatedAttr {
818- fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & ast:: Attribute ) {
819- for BuiltinAttribute { name, gate, .. } in & self . depr_attrs {
820- if attr. ident ( ) . map ( |ident| ident. name ) == Some ( * name) {
821- if let & AttributeGate :: Gated {
822- stability : Stability :: Deprecated ( link, suggestion) ,
823- message,
824- ..
825- } = gate
826- {
827- let suggestion = match suggestion {
828- Some ( suggestion) => {
829- BuiltinDeprecatedAttrLinkSuggestion :: Msg { span : attr. span , suggestion }
830- }
831- None => BuiltinDeprecatedAttrLinkSuggestion :: Default { span : attr. span } ,
832- } ;
833- cx. emit_span_lint (
834- DEPRECATED ,
835- attr. span ,
836- BuiltinDeprecatedAttrLink { name : * name, message, link, suggestion } ,
837- ) ;
838- }
839- return ;
840- }
841- }
842- }
843- }
844-
845800fn warn_if_doc ( cx : & EarlyContext < ' _ > , node_span : Span , node_kind : & str , attrs : & [ ast:: Attribute ] ) {
846801 use rustc_ast:: token:: CommentKind ;
847802
0 commit comments