@@ -22,7 +22,7 @@ use rustc_ast::visit::{FnCtxt, FnKind};
22
22
use rustc_ast:: { self as ast, * } ;
23
23
use rustc_ast_pretty:: pprust:: expr_to_string;
24
24
use rustc_errors:: { Applicability , LintDiagnostic } ;
25
- use rustc_feature:: { AttributeGate , BuiltinAttribute , GateIssue , Stability , deprecated_attributes } ;
25
+ use rustc_feature:: GateIssue ;
26
26
use rustc_hir as hir;
27
27
use rustc_hir:: def:: { DefKind , Res } ;
28
28
use rustc_hir:: def_id:: { CRATE_DEF_ID , DefId , LocalDefId } ;
@@ -48,8 +48,7 @@ use rustc_trait_selection::traits::{self};
48
48
49
49
use crate :: errors:: BuiltinEllipsisInclusiveRangePatterns ;
50
50
use crate :: lints:: {
51
- BuiltinAnonymousParams , BuiltinConstNoMangle , BuiltinDeprecatedAttrLink ,
52
- BuiltinDeprecatedAttrLinkSuggestion , BuiltinDerefNullptr , BuiltinDoubleNegations ,
51
+ BuiltinAnonymousParams , BuiltinConstNoMangle , BuiltinDerefNullptr , BuiltinDoubleNegations ,
53
52
BuiltinDoubleNegationsAddParens , BuiltinEllipsisInclusiveRangePatternsLint ,
54
53
BuiltinExplicitOutlives , BuiltinExplicitOutlivesSuggestion , BuiltinFeatureIssueNote ,
55
54
BuiltinIncompleteFeatures , BuiltinIncompleteFeaturesHelp , BuiltinInternalFeatures ,
@@ -798,50 +797,6 @@ impl EarlyLintPass for AnonymousParameters {
798
797
}
799
798
}
800
799
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
-
845
800
fn warn_if_doc ( cx : & EarlyContext < ' _ > , node_span : Span , node_kind : & str , attrs : & [ ast:: Attribute ] ) {
846
801
use rustc_ast:: token:: CommentKind ;
847
802
0 commit comments