File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 085c813fe3f03c67aa8e8cb7fa005886d9447c50
2
+ refs/heads/master: 1e4de333740690357a8f58883c5c69bf58be1424
Original file line number Diff line number Diff line change @@ -35,15 +35,17 @@ type lookup_fn = fn(file_pos) -> uint;
35
35
36
36
fn lookup_pos ( map : codemap , pos : uint , lookup : lookup_fn ) -> loc {
37
37
let len = vec:: len ( map. files ) ;
38
+ if len > 1 u && map. files [ len - 1 u] . name == "-" {
39
+ // the trailing "-" must be the core_macros inserted by expand_crate,
40
+ // exclude it from the targets to lookup
41
+ len = len - 1 u;
42
+ }
38
43
let a = 0 u;
39
44
let b = len;
40
45
while b - a > 1 u {
41
46
let m = ( a + b) / 2 u;
42
47
if lookup ( map. files [ m] . start_pos ) > pos { b = m; } else { a = m; }
43
48
}
44
- if ( a >= len) {
45
- ret { filename : "-" , line : 0 u, col : 0 u } ;
46
- }
47
49
let f = map. files [ a] ;
48
50
a = 0 u;
49
51
b = vec:: len ( f. lines ) ;
You can’t perform that action at this time.
0 commit comments