about summary refs log tree commit diff
path: root/src/libsyntax/util
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-05-09 08:46:58 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-05-09 08:46:58 +0200
commit8654dfbc2f4c1a6da7c9b8f9cce3cfa9f4bc46bb (patch)
tree3d38eb8b953995f64acfd8f9a151257279b2ced5 /src/libsyntax/util
parent0fa1c1662f993343018c6f0dd25ad3eea83e8f63 (diff)
downloadrust-8654dfbc2f4c1a6da7c9b8f9cce3cfa9f4bc46bb.tar.gz
rust-8654dfbc2f4c1a6da7c9b8f9cce3cfa9f4bc46bb.zip
address fallout in libsyntaxtest.
Diffstat (limited to 'src/libsyntax/util')
-rw-r--r--src/libsyntax/util/parser_testing.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs
index d016eb39239..929f2a6abd6 100644
--- a/src/libsyntax/util/parser_testing.rs
+++ b/src/libsyntax/util/parser_testing.rs
@@ -73,7 +73,11 @@ pub fn string_to_stmt(source_str : String) -> P<ast::Stmt> {
 /// Parse a string, return a pat. Uses "irrefutable"... which doesn't
 /// (currently) affect parsing.
 pub fn string_to_pat(source_str: String) -> P<ast::Pat> {
-    string_to_parser(&new_parse_sess(), source_str).parse_pat()
+    // Binding `sess` and `parser` works around dropck-injected
+    // region-inference issues; see #25212, #22323, #22321.
+    let sess = new_parse_sess();
+    let mut parser = string_to_parser(&sess, source_str);
+    parser.parse_pat()
 }
 
 /// Convert a vector of strings to a vector of ast::Ident's