aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index d925aca..c4cfbe2 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -14102,9 +14102,13 @@ std::unique_ptr<AST::RangeExpr>
Parser<ManagedTokenSource>::parse_nud_range_exclusive_expr (
const_TokenPtr tok, AST::AttrVec outer_attrs ATTRIBUTE_UNUSED)
{
+ auto restrictions = ParseRestrictions ();
+ restrictions.expr_can_be_null = true;
+
// FIXME: this probably parses expressions accidently or whatever
// try parsing RHS (as tok has already been consumed in parse_expression)
- std::unique_ptr<AST::Expr> right = parse_expr (LBP_DOT_DOT, AST::AttrVec ());
+ std::unique_ptr<AST::Expr> right
+ = parse_expr (LBP_DOT_DOT, AST::AttrVec (), restrictions);
Location locus = tok->get_locus ();