We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fa1c16 commit 8654dfbCopy full SHA for 8654dfb
src/libsyntax/util/parser_testing.rs
@@ -73,7 +73,11 @@ pub fn string_to_stmt(source_str : String) -> P<ast::Stmt> {
73
/// Parse a string, return a pat. Uses "irrefutable"... which doesn't
74
/// (currently) affect parsing.
75
pub fn string_to_pat(source_str: String) -> P<ast::Pat> {
76
- string_to_parser(&new_parse_sess(), source_str).parse_pat()
+ // 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()
81
}
82
83
/// Convert a vector of strings to a vector of ast::Ident's
0 commit comments