diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-01-17 17:56:03 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-01-17 17:56:03 -0500 |
| commit | d82d4b66f24e21dd124e1b4765939b230cec3685 (patch) | |
| tree | ed30213d62781bc88774f05b2caa73324719785b /src/libsyntax | |
| parent | 2bade8133c942b4598f41ea92f860da4bdaea67f (diff) | |
| download | rust-d82d4b66f24e21dd124e1b4765939b230cec3685.tar.gz rust-d82d4b66f24e21dd124e1b4765939b230cec3685.zip | |
tolerate `None` return from `get_line`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/json.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index a1c273baeea..adab76309fe 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -296,7 +296,7 @@ impl DiagnosticSpanLine { h_end: usize) -> DiagnosticSpanLine { DiagnosticSpanLine { - text: fm.get_line(index).unwrap().to_owned(), + text: fm.get_line(index).unwrap_or("").to_owned(), highlight_start: h_start, highlight_end: h_end, } |
