about summary refs log tree commit diff
path: root/src/libsyntax/json.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-04-13 07:48:01 +0000
committerbors <bors@rust-lang.org>2019-04-13 07:48:01 +0000
commitaa35e73b258789d93b080e361542d7aa99e7fcd6 (patch)
tree35016b7e8e0758d8c516c47be108c62eb3ede473 /src/libsyntax/json.rs
parent99da733f7f38ce8fe68453e859b7ac96bf7caa0f (diff)
parentba173135becd5681baa67551cafa20ce9a3017e2 (diff)
downloadrust-aa35e73b258789d93b080e361542d7aa99e7fcd6.tar.gz
rust-aa35e73b258789d93b080e361542d7aa99e7fcd6.zip
Auto merge of #59922 - Centril:rollup-0qmx4jg, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #59781 (Remove check_match from const_eval)
 - #59820 (proc_macro: stop using LEB128 for RPC.)
 - #59846 (clarify what the item is in "not a module" error)
 - #59847 (Error when using `catch` after `try`)
 - #59859 (Suggest removing `?` to resolve type errors.)
 - #59862 (Tweak unstable diagnostic output)
 - #59866 (Recover from missing semicolon based on the found token)
 - #59892 (Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/json.rs')
-rw-r--r--src/libsyntax/json.rs24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs
index 9acd0d099a0..838dfc62646 100644
--- a/src/libsyntax/json.rs
+++ b/src/libsyntax/json.rs
@@ -348,19 +348,17 @@ impl DiagnosticSpanLine {
     /// `span` within the line.
     fn from_span(span: Span, je: &JsonEmitter) -> Vec<DiagnosticSpanLine> {
         je.sm.span_to_lines(span)
-             .map(|lines| {
-                 let fm = &*lines.file;
-                 lines.lines
-                      .iter()
-                      .map(|line| {
-                          DiagnosticSpanLine::line_from_source_file(fm,
-                                                                line.line_index,
-                                                                line.start_col.0 + 1,
-                                                                line.end_col.0 + 1)
-                      })
-                     .collect()
-             })
-            .unwrap_or_else(|_| vec![])
+            .map(|lines| {
+                let fm = &*lines.file;
+                lines.lines
+                    .iter()
+                    .map(|line| DiagnosticSpanLine::line_from_source_file(
+                        fm,
+                        line.line_index,
+                        line.start_col.0 + 1,
+                        line.end_col.0 + 1,
+                    )).collect()
+            }).unwrap_or_else(|_| vec![])
     }
 }