Skip to content

Commit 8654dfb

Browse files
committed
address fallout in libsyntaxtest.
1 parent 0fa1c16 commit 8654dfb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libsyntax/util/parser_testing.rs

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

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

0 commit comments

Comments
 (0)