about summary refs log tree commit diff
path: root/src/libsyntax/util/parser_testing.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-02-09 20:15:57 +0000
committerbors <bors@rust-lang.org>2019-02-09 20:15:57 +0000
commit3315728c060b73ccf986c63677c1fcd7d92e15c5 (patch)
tree9abeb03a99a73ce7c4029ddaa0d9696ec220dcbb /src/libsyntax/util/parser_testing.rs
parent4c9233cdebe3d9a46c641a9c608792379490bc45 (diff)
parentfb3c4fbfc33b77b7beeeaf4a749a2081a8bfbc2f (diff)
downloadrust-3315728c060b73ccf986c63677c1fcd7d92e15c5.tar.gz
rust-3315728c060b73ccf986c63677c1fcd7d92e15c5.zip
Auto merge of #57944 - estebank:unclosed-delim-the-quickening, r=oli-obk
Deduplicate mismatched delimiter errors

Delay unmatched delimiter errors until after the parser has run to deduplicate them when parsing and attempt recovering intelligently.

Second attempt at #54029, follow up to #53949. Fix #31528.
Diffstat (limited to 'src/libsyntax/util/parser_testing.rs')
-rw-r--r--src/libsyntax/util/parser_testing.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs
index dbe2b8d39f2..bcf1da66c04 100644
--- a/src/libsyntax/util/parser_testing.rs
+++ b/src/libsyntax/util/parser_testing.rs
@@ -12,8 +12,11 @@ use std::path::PathBuf;
 /// Map a string to tts, using a made-up filename:
 pub fn string_to_stream(source_str: String) -> TokenStream {
     let ps = ParseSess::new(FilePathMapping::empty());
-    source_file_to_stream(&ps, ps.source_map()
-                             .new_source_file(PathBuf::from("bogofile").into(), source_str), None)
+    source_file_to_stream(
+        &ps,
+        ps.source_map().new_source_file(PathBuf::from("bogofile").into(),
+        source_str,
+    ), None).0
 }
 
 /// Map string to parser (via tts)