Skip to content

Commit

Permalink
address fallout in libsyntaxtest.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed May 11, 2015
1 parent 1a44fd1 commit c25ab82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libsyntax/util/parser_testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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
Expand Down

0 comments on commit c25ab82

Please sign in to comment.