diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-07-10 22:14:52 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2021-07-10 23:03:35 +0300 |
| commit | 075a28996c5bef3cd5fcc46717fd426034b03806 (patch) | |
| tree | 562bb750ce25bf127a4847cc352b9fb78445fa0e | |
| parent | 3fc34455f4beed986485466be321600995011a1d (diff) | |
| download | rust-075a28996c5bef3cd5fcc46717fd426034b03806.tar.gz rust-075a28996c5bef3cd5fcc46717fd426034b03806.zip | |
rustc_span: Revert addition of `proc_macro` field to `ExpnKind::Macro`
The flag has a vague meaning and is used for a single diagnostic change that is low benefit and appears only under `-Z macro_backtrace`.
| -rw-r--r-- | clippy_lints/src/misc.rs | 9 | ||||
| -rw-r--r-- | clippy_lints/src/unit_types/unit_cmp.rs | 7 | ||||
| -rw-r--r-- | clippy_utils/src/lib.rs | 14 |
3 files changed, 4 insertions, 26 deletions
diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 804c04fe1b8..7cfce2e61cc 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -662,14 +662,7 @@ fn in_attributes_expansion(expr: &Expr<'_>) -> bool { use rustc_span::hygiene::MacroKind; if expr.span.from_expansion() { let data = expr.span.ctxt().outer_expn_data(); - matches!( - data.kind, - ExpnKind::Macro { - kind: MacroKind::Attr, - name: _, - proc_macro: _ - } - ) + matches!(data.kind, ExpnKind::Macro(MacroKind::Attr, _)) } else { false } diff --git a/clippy_lints/src/unit_types/unit_cmp.rs b/clippy_lints/src/unit_types/unit_cmp.rs index 04542146516..85257f3113c 100644 --- a/clippy_lints/src/unit_types/unit_cmp.rs +++ b/clippy_lints/src/unit_types/unit_cmp.rs @@ -8,12 +8,7 @@ use super::UNIT_CMP; pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { if expr.span.from_expansion() { if let Some(callee) = expr.span.source_callee() { - if let ExpnKind::Macro { - kind: MacroKind::Bang, - name: symbol, - proc_macro: _, - } = callee.kind - { + if let ExpnKind::Macro(MacroKind::Bang, symbol) = callee.kind { if let ExprKind::Binary(ref cmp, left, _) = expr.kind { let op = cmp.node; if op.is_comparison() && cx.typeck_results().expr_ty(left).is_unit() { diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 217a1f4dded..2f10472180f 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -953,12 +953,7 @@ pub fn is_expn_of(mut span: Span, name: &str) -> Option<Span> { let data = span.ctxt().outer_expn_data(); let new_span = data.call_site; - if let ExpnKind::Macro { - kind: MacroKind::Bang, - name: mac_name, - proc_macro: _, - } = data.kind - { + if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind { if mac_name.as_str() == name { return Some(new_span); } @@ -986,12 +981,7 @@ pub fn is_direct_expn_of(span: Span, name: &str) -> Option<Span> { let data = span.ctxt().outer_expn_data(); let new_span = data.call_site; - if let ExpnKind::Macro { - kind: MacroKind::Bang, - name: mac_name, - proc_macro: _, - } = data.kind - { + if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind { if mac_name.as_str() == name { return Some(new_span); } |
