Fix reporting error without span

such as error from the interpreter that the file cannot be loaded
This commit is contained in:
Olivier Goffart 2021-03-24 11:12:38 +01:00
parent d829a18ddd
commit cc619fd7d4

View file

@ -310,7 +310,9 @@ impl BuildDiagnostics {
.inner .inner
.into_iter() .into_iter()
.filter_map(|d| { .filter_map(|d| {
let spans = if let Some(sf) = &d.span.source_file { let spans = if !d.span.span.is_valid() {
vec![]
} else if let Some(sf) = &d.span.source_file {
if let Some(ref mut handle_no_source) = handle_no_source { if let Some(ref mut handle_no_source) = handle_no_source {
if sf.source.is_none() { if sf.source.is_none() {
handle_no_source(d); handle_no_source(d);