@@ -16,6 +16,7 @@ use rustc_middle::lint::in_external_macro;
1616use rustc_middle:: ty;
1717use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
1818use rustc_span:: source_map:: Span ;
19+ use rustc_span:: sym;
1920use rustc_span:: symbol:: { Symbol , SymbolStr } ;
2021use semver:: Version ;
2122
@@ -286,14 +287,14 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
286287 } ,
287288 _ => { } ,
288289 }
289- if items. is_empty ( ) || !attr. has_name ( sym ! ( deprecated) ) {
290+ if items. is_empty ( ) || !attr. has_name ( sym:: deprecated) {
290291 return ;
291292 }
292293 for item in items {
293294 if_chain ! {
294295 if let NestedMetaItem :: MetaItem ( mi) = & item;
295296 if let MetaItemKind :: NameValue ( lit) = & mi. kind;
296- if mi. has_name( sym! ( since) ) ;
297+ if mi. has_name( sym:: since) ;
297298 then {
298299 check_semver( cx, item. span( ) , lit) ;
299300 }
@@ -309,7 +310,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
309310 }
310311 match item. kind {
311312 ItemKind :: ExternCrate ( ..) | ItemKind :: Use ( ..) => {
312- let skip_unused_imports = item. attrs . iter ( ) . any ( |attr| attr. has_name ( sym ! ( macro_use) ) ) ;
313+ let skip_unused_imports = item. attrs . iter ( ) . any ( |attr| attr. has_name ( sym:: macro_use) ) ;
313314
314315 for attr in item. attrs {
315316 if in_external_macro ( cx. sess ( ) , attr. span ) {
@@ -326,7 +327,7 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
326327 match item. kind {
327328 ItemKind :: Use ( ..) => {
328329 if is_word ( lint, sym ! ( unused_imports) )
329- || is_word ( lint, sym ! ( deprecated) )
330+ || is_word ( lint, sym:: deprecated)
330331 || is_word ( lint, sym ! ( unreachable_pub) )
331332 || is_word ( lint, sym ! ( unused) )
332333 || extract_clippy_lint ( lint)
@@ -411,8 +412,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_>, ident: &str, items: &[NestedMet
411412 let lint_store = cx. lints ( ) ;
412413 for lint in items {
413414 if let Some ( lint_name) = extract_clippy_lint ( lint) {
414- if let CheckLintNameResult :: Tool ( Err ( ( None , _) ) ) =
415- lint_store. check_lint_name ( & lint_name, Some ( sym ! ( clippy) ) )
415+ if let CheckLintNameResult :: Tool ( Err ( ( None , _) ) ) = lint_store. check_lint_name ( & lint_name, Some ( sym:: clippy) )
416416 {
417417 span_lint_and_then (
418418 cx,
@@ -529,10 +529,10 @@ fn check_attrs(cx: &LateContext<'_>, span: Span, name: Symbol, attrs: &[Attribut
529529
530530 for attr in attrs {
531531 if let Some ( values) = attr. meta_item_list ( ) {
532- if values. len ( ) != 1 || !attr. has_name ( sym ! ( inline) ) {
532+ if values. len ( ) != 1 || !attr. has_name ( sym:: inline) {
533533 continue ;
534534 }
535- if is_word ( & values[ 0 ] , sym ! ( always) ) {
535+ if is_word ( & values[ 0 ] , sym:: always) {
536536 span_lint (
537537 cx,
538538 INLINE_ALWAYS ,
@@ -623,12 +623,12 @@ fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::It
623623fn check_deprecated_cfg_attr ( cx : & EarlyContext < ' _ > , attr : & Attribute ) {
624624 if_chain ! {
625625 // check cfg_attr
626- if attr. has_name( sym! ( cfg_attr) ) ;
626+ if attr. has_name( sym:: cfg_attr) ;
627627 if let Some ( items) = attr. meta_item_list( ) ;
628628 if items. len( ) == 2 ;
629629 // check for `rustfmt`
630630 if let Some ( feature_item) = items[ 0 ] . meta_item( ) ;
631- if feature_item. has_name( sym! ( rustfmt) ) ;
631+ if feature_item. has_name( sym:: rustfmt) ;
632632 // check for `rustfmt_skip` and `rustfmt::skip`
633633 if let Some ( skip_item) = & items[ 1 ] . meta_item( ) ;
634634 if skip_item. has_name( sym!( rustfmt_skip) ) ||
@@ -690,7 +690,7 @@ fn check_mismatched_target_os(cx: &EarlyContext<'_>, attr: &Attribute) {
690690 }
691691
692692 if_chain ! {
693- if attr. has_name( sym! ( cfg) ) ;
693+ if attr. has_name( sym:: cfg) ;
694694 if let Some ( list) = attr. meta_item_list( ) ;
695695 let mismatched = find_mismatched_target_os( & list) ;
696696 if !mismatched. is_empty( ) ;
0 commit comments