diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-06-09 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-06-09 00:33:46 +0200 |
| commit | fab319be73bac3773eb467139501b89b6ae3d13b (patch) | |
| tree | 89f616633cc9cedc5593d8ab14f6f768dd2490c7 /compiler/rustc_span | |
| parent | ed597e7e19d0fe716d9f81b1e840a5abbfd7c28d (diff) | |
| download | rust-fab319be73bac3773eb467139501b89b6ae3d13b.tar.gz rust-fab319be73bac3773eb467139501b89b6ae3d13b.zip | |
Print dummy spans as `no-location`
Diffstat (limited to 'compiler/rustc_span')
| -rw-r--r-- | compiler/rustc_span/src/source_map.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_span/src/source_map.rs b/compiler/rustc_span/src/source_map.rs index 0dadd419200..1d45cd172b3 100644 --- a/compiler/rustc_span/src/source_map.rs +++ b/compiler/rustc_span/src/source_map.rs @@ -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(); } |
