aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/rust/ast/rust-item.h7
-rw-r--r--gcc/rust/hir/tree/rust-hir-item.h7
-rw-r--r--gcc/rust/parse/rust-parse-impl.h4
3 files changed, 11 insertions, 7 deletions
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index fb1cb09..d075a57 100644
--- a/gcc/rust/ast/rust-item.h
+++ b/gcc/rust/ast/rust-item.h
@@ -190,13 +190,14 @@ class LifetimeWhereClauseItem : public WhereClauseItem
// LifetimeBounds lifetime_bounds;
std::vector<Lifetime> lifetime_bounds; // inlined lifetime bounds
- // should this store location info?
+ Location locus;
public:
LifetimeWhereClauseItem (Lifetime lifetime,
- std::vector<Lifetime> lifetime_bounds)
+ std::vector<Lifetime> lifetime_bounds,
+ Location locus)
: lifetime (std::move (lifetime)),
- lifetime_bounds (std::move (lifetime_bounds))
+ lifetime_bounds (std::move (lifetime_bounds)), locus (locus)
{}
std::string as_string () const override;
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 68ba69f..c52870d 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -165,13 +165,14 @@ class LifetimeWhereClauseItem : public WhereClauseItem
// LifetimeBounds lifetime_bounds;
std::vector<Lifetime> lifetime_bounds; // inlined lifetime bounds
- // should this store location info?
+ Location locus;
public:
LifetimeWhereClauseItem (Lifetime lifetime,
- std::vector<Lifetime> lifetime_bounds)
+ std::vector<Lifetime> lifetime_bounds,
+ Location locus)
: lifetime (std::move (lifetime)),
- lifetime_bounds (std::move (lifetime_bounds))
+ lifetime_bounds (std::move (lifetime_bounds)), locus (locus)
{}
std::string as_string () const override;
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index c2d3720..14e4e80 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -3579,9 +3579,11 @@ Parser<ManagedTokenSource>::parse_lifetime_where_clause_item ()
std::vector<AST::Lifetime> lifetime_bounds = parse_lifetime_bounds ();
// TODO: have end token passed in?
+ Location locus = lifetime.get_locus ();
+
return std::unique_ptr<AST::LifetimeWhereClauseItem> (
new AST::LifetimeWhereClauseItem (std::move (lifetime),
- std::move (lifetime_bounds)));
+ std::move (lifetime_bounds), locus));
}
// Parses a type bound where clause item.