@@ -5,19 +5,19 @@ use crate::attributes::diagnostic::*;
55use crate :: attributes:: prelude:: * ;
66
77#[ derive( Default ) ]
8- pub ( crate ) struct OnUnknownItemParser {
8+ pub ( crate ) struct OnUnknownParser {
99 span : Option < Span > ,
1010 directive : Option < ( Span , Directive ) > ,
1111}
1212
13- impl OnUnknownItemParser {
13+ impl OnUnknownParser {
1414 fn parse < ' sess , S : Stage > (
1515 & mut self ,
1616 cx : & mut AcceptContext < ' _ , ' sess , S > ,
1717 args : & ArgParser ,
1818 mode : Mode ,
1919 ) {
20- if !cx. features ( ) . diagnostic_on_unknown_item ( ) {
20+ if !cx. features ( ) . diagnostic_on_unknown ( ) {
2121 return ;
2222 }
2323 let span = cx. attr_span ;
@@ -28,15 +28,15 @@ impl OnUnknownItemParser {
2828 ArgParser :: NoArgs | ArgParser :: List ( _) => {
2929 cx. emit_lint (
3030 MALFORMED_DIAGNOSTIC_ATTRIBUTES ,
31- AttributeLintKind :: MissingOptionsForOnUnknownItem ,
31+ AttributeLintKind :: MissingOptionsForOnUnknown ,
3232 span,
3333 ) ;
3434 return ;
3535 }
3636 ArgParser :: NameValue ( _) => {
3737 cx. emit_lint (
3838 MALFORMED_DIAGNOSTIC_ATTRIBUTES ,
39- AttributeLintKind :: MalformedOnUnknownItemdAttr { span } ,
39+ AttributeLintKind :: MalformedOnUnknownAttr { span } ,
4040 span,
4141 ) ;
4242 return ;
@@ -49,20 +49,20 @@ impl OnUnknownItemParser {
4949 }
5050}
5151
52- impl < S : Stage > AttributeParser < S > for OnUnknownItemParser {
52+ impl < S : Stage > AttributeParser < S > for OnUnknownParser {
5353 const ATTRIBUTES : AcceptMapping < Self , S > = & [ (
54- & [ sym:: diagnostic, sym:: on_unknown_item ] ,
54+ & [ sym:: diagnostic, sym:: on_unknown ] ,
5555 template ! ( List : & [ r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""# ] ) ,
5656 |this, cx, args| {
57- this. parse ( cx, args, Mode :: DiagnosticOnUnknownItem ) ;
57+ this. parse ( cx, args, Mode :: DiagnosticOnUnknown ) ;
5858 } ,
5959 ) ] ;
6060 //FIXME attribute is not parsed for non-use statements but diagnostics are issued in `check_attr.rs`
6161 const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( ALL_TARGETS ) ;
6262
6363 fn finalize ( self , _cx : & FinalizeContext < ' _ , ' _ , S > ) -> Option < AttributeKind > {
6464 if let Some ( span) = self . span {
65- Some ( AttributeKind :: OnUnknownItem {
65+ Some ( AttributeKind :: OnUnknown {
6666 span,
6767 directive : self . directive . map ( |d| Box :: new ( d. 1 ) ) ,
6868 } )
0 commit comments