Skip to content

Commit ca08760

Browse files
pnkfelixalexcrichton
authored andcommitted
address fallout in libsyntaxtest.
1 parent 65bf8f1 commit ca08760

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/libsyntax/util/parser_testing.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ pub fn string_to_stmt(source_str : String) -> P<ast::Stmt> {
7272
/// Parse a string, return a pat. Uses "irrefutable"... which doesn't
7373
/// (currently) affect parsing.
7474
pub fn string_to_pat(source_str: String) -> P<ast::Pat> {
75-
string_to_parser(&new_parse_sess(), source_str).parse_pat()
75+
// Binding `sess` and `parser` works around dropck-injected
76+
// region-inference issues; see #25212, #22323, #22321.
77+
let sess = new_parse_sess();
78+
let mut parser = string_to_parser(&sess, source_str);
79+
parser.parse_pat()
7680
}
7781

7882
/// Convert a vector of strings to a vector of ast::Ident's

0 commit comments

Comments
 (0)