aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCohenArthur <arthur.cohen@epita.fr>2021-04-25 15:01:29 +0200
committerCohenArthur <arthur.cohen@epita.fr>2021-04-25 17:07:34 +0200
commit8ee80abd2fb2bb6870c539a7e407b9944e1c2c46 (patch)
tree01a4893167cda26e3576017e9aee5c06eb390b09
parentde9af784e79926d01e8c030e999becc4b8bfad0f (diff)
downloadgcc-8ee80abd2fb2bb6870c539a7e407b9944e1c2c46.zip
gcc-8ee80abd2fb2bb6870c539a7e407b9944e1c2c46.tar.gz
gcc-8ee80abd2fb2bb6870c539a7e407b9944e1c2c46.tar.bz2
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.
-rw-r--r--gcc/rust/ast/rust-expr.h6
1 files changed, 3 insertions, 3 deletions
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<std::unique_ptr<Pattern> > match_arm_patterns,
std::unique_ptr<Expr> value, std::unique_ptr<BlockExpr> if_block,
- std::vector<Attribute> /* outer_attrs */, Location locus)
- : match_arm_patterns (std::move (match_arm_patterns)),
+ std::vector<Attribute> 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)