diff options
author | @mvvsmk <mvvsmanojkumar@gmail.com> | 2022-02-03 07:27:20 +0530 |
---|---|---|
committer | @mvvsmk <mvvsmanojkumar@gmail.com> | 2022-02-04 13:49:50 +0530 |
commit | b92a9b80faa4b6daeca3e94db8bcdebdeec0b859 (patch) | |
tree | 3285d1e70528eab92bd936439333cdb3cbb0dd3a /gcc/rust/ast | |
parent | 6508698504a2bb2e6b92b74f11d55ca4282927f4 (diff) | |
download | gcc-b92a9b80faa4b6daeca3e94db8bcdebdeec0b859.zip gcc-b92a9b80faa4b6daeca3e94db8bcdebdeec0b859.tar.gz gcc-b92a9b80faa4b6daeca3e94db8bcdebdeec0b859.tar.bz2 |
Upated parameterised constuctor of MatchArm to take location data
Addresses issue #863
1)comment removed form rust-expr.h
2)changed partameterized constructor and static function in
rust-hir-expr.h
3)changed line 697 to pass expr.get_locus() in rust-ast-lower
4)changed parameterised constructor in rust-expr.h
5)changed line 8563 in rust-parse-impl.h to pass location data.
Signed-off-by : M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
Diffstat (limited to 'gcc/rust/ast')
-rw-r--r-- | gcc/rust/ast/rust-expr.h | 9 |
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; |