From 8ee80abd2fb2bb6870c539a7e407b9944e1c2c46 Mon Sep 17 00:00:00 2001 From: CohenArthur Date: Sun, 25 Apr 2021 15:01:29 +0200 Subject: IfLetExpr: Assign outer_attrs in constructor The `outer_attrs` member was not used in the IfLetExpr type, as it was believed to be forbidden. However, that assumption was false and outer_attrs are indeed allowed here. This commit also fixes the unused warning for the `outer_attrs` constructor's argument, which was not assigned before. --- gcc/rust/ast/rust-expr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index eb56b65..4bb3557 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -4374,11 +4374,11 @@ public: IfLetExpr (std::vector > match_arm_patterns, std::unique_ptr value, std::unique_ptr if_block, - std::vector /* outer_attrs */, Location locus) - : match_arm_patterns (std::move (match_arm_patterns)), + std::vector outer_attrs, Location locus) + : outer_attrs (std::move (outer_attrs)), + match_arm_patterns (std::move (match_arm_patterns)), value (std::move (value)), if_block (std::move (if_block)), locus (locus) {} - // outer attributes not allowed on if let exprs either // copy constructor with clone IfLetExpr (IfLetExpr const &other) -- cgit v1.1