aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r--gcc/rust/ast/rust-expr.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index 2f46fee..3f3ed5c 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -4225,7 +4225,6 @@ private:
// inlined from MatchArmGuard
std::unique_ptr<Expr> guard_expr;
- // TODO: should this store location data?
Location locus;
public:
@@ -4234,9 +4233,8 @@ public:
// Constructor for match arm with a guard expression
MatchArm (std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
- std::unique_ptr<Expr> guard_expr = nullptr,
- std::vector<Attribute> outer_attrs = std::vector<Attribute> (),
- Location locus = Location ())
+ Location locus, std::unique_ptr<Expr> guard_expr = nullptr,
+ std::vector<Attribute> outer_attrs = std::vector<Attribute> ())
: outer_attrs (std::move (outer_attrs)),
match_arm_patterns (std::move (match_arm_patterns)),
guard_expr (std::move (guard_expr)), locus (locus)
@@ -4285,7 +4283,8 @@ public:
// Creates a match arm in an error state.
static MatchArm create_error ()
{
- return MatchArm (std::vector<std::unique_ptr<Pattern> > ());
+ Location locus = Location ();
+ return MatchArm (std::vector<std::unique_ptr<Pattern> > (), locus);
}
std::string as_string () const;