mozilla/rust — pull request #12670 by dmski (2014-03-03 12:07:57+00:00)
Title: libsyntax: fixed converting Spans to stuff.

Before this change span_to_* methods on CodeMap assumed that Span includes both of its endpoints (by trying to lookup span.hi in CodeMap).
This sometimes led to incorrect error reporting and ICEs, as byte position lookup would overflow into the next available FileMap.

Example:
````

pub fn main() {
let mut num = 3;
let refe = &mut num;
*refe = 5;
println!("{}", num);
}````

(note the empty line in the beginning and the absence of newline at the end)

The above would have caused ICE when trying to report where "refe" borrow ends.
The above without an empty line in the beginning would have reported borrow end to be the first line.

Most probably, this is also responsible for (at least some occurrences of) issue #8256.