diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-12-05 15:13:24 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-01-08 15:41:53 -0800 |
| commit | c3a74d87bd5a8f8bd32350f74a3fa4fb1f9bf5e6 (patch) | |
| tree | d57ad7fd251f4dfbe2d43e32ca160372503e17a6 /src/libsyntax/codemap.rs | |
| parent | 3b71d14442a1942ecf45fc4ac619f473e8367ae6 (diff) | |
| download | rust-c3a74d87bd5a8f8bd32350f74a3fa4fb1f9bf5e6.tar.gz rust-c3a74d87bd5a8f8bd32350f74a3fa4fb1f9bf5e6.zip | |
Implement GLB algorithm. (Issue #2263)
r=brson
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index b717d084789..1f26711abb9 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -315,6 +315,10 @@ pub impl CodeMap { } pub fn span_to_str(&self, sp: span) -> ~str { + if self.files.len() == 0 && sp == ast_util::dummy_sp() { + return ~"no-location"; + } + let lo = self.lookup_char_pos_adj(sp.lo); let hi = self.lookup_char_pos_adj(sp.hi); return fmt!("%s:%u:%u: %u:%u", lo.filename, |
