graydon/rust — pull request #1219 by lht (2011-11-24 07:07:38+00:00)
Title: rustc: Fix position of diagnostic highlight lines

Diagnostic highlight lines are incorrect placed when the related line
number is multiplies of 10.

For example, diagnostic highlight is misplaced when compiling the following code.

```javascript
use std; // 1
// 2
fn main() { // 3
import std::vec; // 4
// 5
// 6
// 7
{ // 8
// 9
import std::sha; // 10
} // 11
}
```

```javascript
import-in-block.rs:10:8: 10:23 error: unresolved import: sha
import-in-block.rs:10 import std::sha; // 10
^~~~~~~~~~~~~~~
```

The root cause is line number is treated as 0 based (should be 1 based)
when calculating offset of line number digits.