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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 731e0b3..fa6d409 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -12547,6 +12547,8 @@ Parser<ManagedTokenSource>::null_denotation (const_TokenPtr tok,
case MINUS: { // unary minus
ParseRestrictions entered_from_unary;
entered_from_unary.entered_from_unary = true;
+ if (!restrictions.can_be_struct_expr)
+ entered_from_unary.can_be_struct_expr = false;
std::unique_ptr<AST::Expr> expr
= parse_expr (LBP_UNARY_MINUS, {}, entered_from_unary);
@@ -12571,6 +12573,8 @@ Parser<ManagedTokenSource>::null_denotation (const_TokenPtr tok,
case EXCLAM: { // logical or bitwise not
ParseRestrictions entered_from_unary;
entered_from_unary.entered_from_unary = true;
+ if (!restrictions.can_be_struct_expr)
+ entered_from_unary.can_be_struct_expr = false;
std::unique_ptr<AST::Expr> expr
= parse_expr (LBP_UNARY_EXCLAM, {}, entered_from_unary);