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 | 28f4dba4388c81a77b656c624e796f5b5c589ba0 (patch) | |
| tree | 6c8ba083e4d0b1d915c345981c56532be4e8cafb /compiler/rustc_lint/src | |
| parent | a31431fce770ff90a347fd6114ac294e4568cbd8 (diff) | |
| download | rust-28f4dba4388c81a77b656c624e796f5b5c589ba0.tar.gz rust-28f4dba4388c81a77b656c624e796f5b5c589ba0.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`.
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/internal.rs | 19 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/non_fmt_panic.rs | 6 |
2 files changed, 5 insertions, 20 deletions
diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index 0398d4a9961..9b1a339572e 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -248,21 +248,10 @@ impl EarlyLintPass for LintPassImpl { if last.ident.name == sym::LintPass { let expn_data = lint_pass.path.span.ctxt().outer_expn_data(); let call_site = expn_data.call_site; - if !matches!( - expn_data.kind, - ExpnKind::Macro { - kind: MacroKind::Bang, - name: sym::impl_lint_pass, - proc_macro: _ - } - ) && !matches!( - call_site.ctxt().outer_expn_data().kind, - ExpnKind::Macro { - kind: MacroKind::Bang, - name: sym::declare_lint_pass, - proc_macro: _ - } - ) { + if expn_data.kind != ExpnKind::Macro(MacroKind::Bang, sym::impl_lint_pass) + && call_site.ctxt().outer_expn_data().kind + != ExpnKind::Macro(MacroKind::Bang, sym::declare_lint_pass) + { cx.struct_span_lint( LINT_PASS_IMPL_WITHOUT_MACRO, lint_pass.path.span, diff --git a/compiler/rustc_lint/src/non_fmt_panic.rs b/compiler/rustc_lint/src/non_fmt_panic.rs index 99a88f6bf61..a32caf1bc43 100644 --- a/compiler/rustc_lint/src/non_fmt_panic.rs +++ b/compiler/rustc_lint/src/non_fmt_panic.rs @@ -256,10 +256,6 @@ fn panic_call<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>) -> (Span, } let macro_symbol = - if let hygiene::ExpnKind::Macro { kind: _, name: symbol, proc_macro: _ } = expn.kind { - symbol - } else { - Symbol::intern("panic") - }; + if let hygiene::ExpnKind::Macro(_, symbol) = expn.kind { symbol } else { sym::panic }; (expn.call_site, panic_macro, macro_symbol.as_str()) } |
