From b376c0cb37c9f712d60d8aad9aab37237adf3563 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Mon, 29 Aug 2022 16:37:16 +0200 Subject: parser: Parse RangeFullExpr without erroring out --- gcc/rust/parse/rust-parse-impl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/rust/parse') 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 Parser::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 right = parse_expr (LBP_DOT_DOT, AST::AttrVec ()); + std::unique_ptr right + = parse_expr (LBP_DOT_DOT, AST::AttrVec (), restrictions); Location locus = tok->get_locus (); -- cgit v1.1