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