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/internal.rs | |
| 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/internal.rs')
| -rw-r--r-- | compiler/rustc_lint/src/internal.rs | 19 |
1 files changed, 4 insertions, 15 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, |
