diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-05-12 12:48:14 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-05-12 12:48:14 +1200 |
| commit | e0216fcc42d5f4961d07378a783c87814097015f (patch) | |
| tree | e5f503c129942a2b7c2815b1c8e4db85b5bbcf1b /src/libsyntax/util/parser_testing.rs | |
| parent | aa5ca282b20391c6df51fdfa94e0de5672ccfac1 (diff) | |
| parent | 750f2c63f2737305d33288303cdecb7a470a7922 (diff) | |
| download | rust-e0216fcc42d5f4961d07378a783c87814097015f.tar.gz rust-e0216fcc42d5f4961d07378a783c87814097015f.zip | |
Merge branch 'master' into
Diffstat (limited to 'src/libsyntax/util/parser_testing.rs')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 6 |
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 |
