Print dummy spans as no-location

This commit is contained in:
Tomasz Miąsko 2021-06-09 00:00:00 +00:00
parent ed597e7e19
commit fab319be73
5 changed files with 9 additions and 9 deletions

View file

@ -407,7 +407,7 @@ impl SourceMap {
}
fn span_to_string(&self, sp: Span, prefer_local: bool) -> String {
if self.files.borrow().source_files.is_empty() && sp.is_dummy() {
if self.files.borrow().source_files.is_empty() || sp.is_dummy() {
return "no-location".to_string();
}