@@ -669,6 +669,22 @@ impl DeprecatedAttr {
669
669
}
670
670
}
671
671
672
+ fn lint_deprecated_attr (
673
+ cx : & EarlyContext < ' _ > ,
674
+ attr : & ast:: Attribute ,
675
+ msg : & str ,
676
+ suggestion : Option < & str > ,
677
+ ) {
678
+ cx. struct_span_lint ( DEPRECATED , attr. span , & msg)
679
+ . span_suggestion_short (
680
+ attr. span ,
681
+ suggestion. unwrap_or ( "remove this attribute" ) ,
682
+ String :: new ( ) ,
683
+ Applicability :: MachineApplicable
684
+ )
685
+ . emit ( ) ;
686
+ }
687
+
672
688
impl EarlyLintPass for DeprecatedAttr {
673
689
fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & ast:: Attribute ) {
674
690
for & & ( n, _, _, ref g) in & self . depr_attrs {
@@ -679,18 +695,15 @@ impl EarlyLintPass for DeprecatedAttr {
679
695
_) = g {
680
696
let msg = format ! ( "use of deprecated attribute `{}`: {}. See {}" ,
681
697
name, reason, link) ;
682
- let mut err = cx. struct_span_lint ( DEPRECATED , attr. span , & msg) ;
683
- err. span_suggestion_short (
684
- attr. span ,
685
- suggestion. unwrap_or ( "remove this attribute" ) ,
686
- String :: new ( ) ,
687
- Applicability :: MachineApplicable
688
- ) ;
689
- err. emit ( ) ;
698
+ lint_deprecated_attr ( cx, attr, & msg, suggestion) ;
690
699
}
691
700
return ;
692
701
}
693
702
}
703
+ if attr. check_name ( sym:: no_start) || attr. check_name ( sym:: crate_id) {
704
+ let msg = format ! ( "use of deprecated attribute `{}`: no longer used." , attr. path) ;
705
+ lint_deprecated_attr ( cx, attr, & msg, None ) ;
706
+ }
694
707
}
695
708
}
696
709
0 commit comments