diff options
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 30f226e..cb06b28 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -12633,11 +12633,10 @@ Parser<ManagedTokenSource>::null_denotation (const_TokenPtr tok, std::unique_ptr<AST::Expr> expr = nullptr; bool is_mut_borrow = false; - /* HACK: as struct expressions should always be value expressions, - * cannot be referenced */ ParseRestrictions entered_from_unary; entered_from_unary.entered_from_unary = true; - entered_from_unary.can_be_struct_expr = false; + if (!restrictions.can_be_struct_expr) + entered_from_unary.can_be_struct_expr = false; if (lexer.peek_token ()->get_id () == MUT) { |