File tree Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -662,14 +662,7 @@ fn in_attributes_expansion(expr: &Expr<'_>) -> bool {
662662 use rustc_span:: hygiene:: MacroKind ;
663663 if expr. span . from_expansion ( ) {
664664 let data = expr. span . ctxt ( ) . outer_expn_data ( ) ;
665- matches ! (
666- data. kind,
667- ExpnKind :: Macro {
668- kind: MacroKind :: Attr ,
669- name: _,
670- proc_macro: _
671- }
672- )
665+ matches ! ( data. kind, ExpnKind :: Macro ( MacroKind :: Attr , _) )
673666 } else {
674667 false
675668 }
Original file line number Diff line number Diff line change @@ -8,12 +8,7 @@ use super::UNIT_CMP;
88pub ( super ) fn check ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) {
99 if expr. span . from_expansion ( ) {
1010 if let Some ( callee) = expr. span . source_callee ( ) {
11- if let ExpnKind :: Macro {
12- kind : MacroKind :: Bang ,
13- name : symbol,
14- proc_macro : _,
15- } = callee. kind
16- {
11+ if let ExpnKind :: Macro ( MacroKind :: Bang , symbol) = callee. kind {
1712 if let ExprKind :: Binary ( ref cmp, left, _) = expr. kind {
1813 let op = cmp. node ;
1914 if op. is_comparison ( ) && cx. typeck_results ( ) . expr_ty ( left) . is_unit ( ) {
Original file line number Diff line number Diff line change @@ -953,12 +953,7 @@ pub fn is_expn_of(mut span: Span, name: &str) -> Option<Span> {
953953 let data = span. ctxt ( ) . outer_expn_data ( ) ;
954954 let new_span = data. call_site ;
955955
956- if let ExpnKind :: Macro {
957- kind : MacroKind :: Bang ,
958- name : mac_name,
959- proc_macro : _,
960- } = data. kind
961- {
956+ if let ExpnKind :: Macro ( MacroKind :: Bang , mac_name) = data. kind {
962957 if mac_name. as_str ( ) == name {
963958 return Some ( new_span) ;
964959 }
@@ -986,12 +981,7 @@ pub fn is_direct_expn_of(span: Span, name: &str) -> Option<Span> {
986981 let data = span. ctxt ( ) . outer_expn_data ( ) ;
987982 let new_span = data. call_site ;
988983
989- if let ExpnKind :: Macro {
990- kind : MacroKind :: Bang ,
991- name : mac_name,
992- proc_macro : _,
993- } = data. kind
994- {
984+ if let ExpnKind :: Macro ( MacroKind :: Bang , mac_name) = data. kind {
995985 if mac_name. as_str ( ) == name {
996986 return Some ( new_span) ;
997987 }
You can’t perform that action at this time.
0 commit comments