syntax: Make def-site span mandatory in ExpnInfo/MacroBacktrace/DiagnosticSpanMacroExpansion

We have to deal with dummy spans anyway

Remove def-site span from expander interfaces.
It's not used by the expansion infra, only by specific expanders, which can keep it themselves if they want it.
This commit is contained in:
Vadim Petrochenkov 2019-06-30 03:05:52 +03:00
parent a138e9d625
commit 3eafaae510
12 changed files with 61 additions and 77 deletions

View file

@ -170,7 +170,7 @@ struct DiagnosticSpanMacroExpansion {
macro_decl_name: String,
/// span where macro was defined (if known)
def_site_span: Option<DiagnosticSpan>,
def_site_span: DiagnosticSpan,
}
#[derive(RustcEncodable)]
@ -300,14 +300,13 @@ impl DiagnosticSpan {
None,
backtrace,
je);
let def_site_span = bt.def_site_span.map(|sp| {
Self::from_span_full(sp,
let def_site_span =
Self::from_span_full(bt.def_site_span,
false,
None,
None,
vec![].into_iter(),
je)
});
je);
Box::new(DiagnosticSpanMacroExpansion {
span: call_site,
macro_decl_name: bt.macro_decl_name,