rust/src/libsyntax
bors a39d4fc684 Auto merge of #25013 - pnkfelix:span_to_lines-oflo, r=huonw
Guard against overflow in `codemap::span_to_lines`.

(Revised/expanded version of PR #24976)

Make `span_to_lines` to return a `Result`.

In `diagnostic`, catch `Err` from `span_to_lines` and print `"(unprintable span)"` instead.

----

There a number of recent issues that report the bug here.  See e.g. #24761 and #24954.

This change *might* fix them. However, that is *not* its main goal. The main goals are:

 1. Make it possible for callers to recover from an error here, and

 2. Insert a more conservative check, in that we are also checking that the files match up.

----

As a drive-by, fix #24997 , which was causing my attempts to `make check-stage1` on an `--enable-debug` build to fail.
2015-05-07 15:25:09 +00:00
..
ast_map Structural changes for associated constants 2015-04-23 21:02:25 -06:00
diagnostics Add metadata output to the diagnostics system. 2015-04-30 08:59:53 +10:00
ext Rename AstBuilder::expr_int -> AstBuilder::expr_isize 2015-05-02 13:57:58 +05:30
parse Use empty() instead of a special const 2015-05-05 22:03:45 -04:00
print Correct pretty-printing of type Foo<T> where T: Bound = ...; 2015-05-04 10:21:39 +02:00
util Change name of unit test sub-module to "tests". 2015-04-24 23:06:41 +02:00
abi.rs
ast_util.rs Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis 2015-04-27 16:45:21 +00:00
ast.rs Fix spelling errors in documentation. 2015-05-04 13:21:27 -04:00
attr.rs
codemap.rs Auto merge of #25013 - pnkfelix:span_to_lines-oflo, r=huonw 2015-05-07 15:25:09 +00:00
config.rs
diagnostic.rs Guard against overflow in codemap::span_to_lines. 2015-05-05 12:51:09 +02:00
feature_gate.rs Register new snapshots 2015-04-28 17:23:45 -07:00
fold.rs Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis 2015-04-27 16:45:21 +00:00
lib.rs syntax: Avoid reallocating or copying in CodeMap::new_filemap 2015-05-01 19:51:31 +02:00
owned_slice.rs
ptr.rs
show_span.rs
std_inject.rs
str.rs
test.rs
visit.rs Get associated consts working in match patterns. 2015-04-23 21:02:29 -06:00