]> git.lizzy.rs Git - rust.git/commitdiff
fix overflow due to multiline error span
authorOliver Schneider <github333195615777966@oli-obk.de>
Fri, 29 Jan 2016 10:25:20 +0000 (11:25 +0100)
committerOliver Schneider <github333195615777966@oli-obk.de>
Fri, 29 Jan 2016 10:25:20 +0000 (11:25 +0100)
src/libsyntax/errors/emitter.rs

index c1239bfd66db82042d5f9b3e393e2cdd86999516..4b6f42db50d8e0e2bd428659432908d14ab6a319 100644 (file)
@@ -518,7 +518,7 @@ fn end_highlight_lines(&mut self,
                 };
                 let lo = self.cm.lookup_char_pos(sp.lo);
                 let hi = self.cm.lookup_char_pos(sp.hi);
-                let elide_sp = (lo.line - hi.line) > MAX_SP_LINES;
+                let elide_sp = (hi.line - lo.line) > MAX_SP_LINES;
 
                 let line_num = line.line_index + 1;
                 if !(lo.line <= line_num && hi.line >= line_num) {