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`.
This commit is contained in:
Vadim Petrochenkov 2021-07-10 22:14:52 +03:00
parent a31431fce7
commit 28f4dba438
19 changed files with 37 additions and 118 deletions

View file

@ -309,9 +309,7 @@ pub trait Emitter {
// are some which do actually involve macros.
ExpnKind::Inlined | ExpnKind::Desugaring(..) | ExpnKind::AstPass(..) => None,
ExpnKind::Macro { kind: macro_kind, name, proc_macro: _ } => {
Some((macro_kind, name))
}
ExpnKind::Macro(macro_kind, name) => Some((macro_kind, name)),
}
});
@ -372,19 +370,10 @@ pub trait Emitter {
new_labels
.push((trace.call_site, "in the inlined copy of this code".to_string()));
} else if always_backtrace {
let proc_macro = if let ExpnKind::Macro { kind: _, name: _, proc_macro: true } =
trace.kind
{
"procedural macro "
} else {
""
};
new_labels.push((
trace.def_site,
format!(
"in this expansion of {}`{}`{}",
proc_macro,
"in this expansion of `{}`{}",
trace.kind.descr(),
if macro_backtrace.len() > 1 {
// if macro_backtrace.len() == 1 it'll be
@ -410,11 +399,7 @@ pub trait Emitter {
// and it needs an "in this macro invocation" label to match that.
let redundant_span = trace.call_site.contains(sp);
if !redundant_span
&& matches!(
trace.kind,
ExpnKind::Macro { kind: MacroKind::Bang, name: _, proc_macro: _ }
)
if !redundant_span && matches!(trace.kind, ExpnKind::Macro(MacroKind::Bang, _))
|| always_backtrace
{
new_labels.push((