aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-10-30 12:02:17 +0000
committerGitHub <noreply@github.com>2021-10-30 12:02:17 +0000
commita9daecd2a35f7caebb02feb4dbb2dc89f3165cdb (patch)
treee20c3965e480c2ce76ee5276a2b8a3b96fd3ba9a /gcc/rust/parse/rust-parse-impl.h
parentcba61d8dcbe1ac0fb23a96b2974541b201292465 (diff)
parenta66dd96413432095ef13e6429f7acb3cb06f4f0f (diff)
downloadgcc-a9daecd2a35f7caebb02feb4dbb2dc89f3165cdb.zip
gcc-a9daecd2a35f7caebb02feb4dbb2dc89f3165cdb.tar.gz
gcc-a9daecd2a35f7caebb02feb4dbb2dc89f3165cdb.tar.bz2
Merge #778
778: Add location info in AST::TypeBoundWhereClauseItem and HIR::TypeBoundWhereClauseItem r=philberty a=npate012 Location info has been added to AST::TypeBoundWhereClauseItem and HIR::TypeBoundWhereClauseItem. parse_type_bound_where_clause_item () has been modified to fetch location info and store it in AST::TypeBoundWhereClauseItem. Fixes #766 Signed-off-by: Nirmal Patel <npate012@gmail.com> Co-authored-by: Nirmal Patel <npate012@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 8bddfcd..52aba4f 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -3612,10 +3612,12 @@ Parser<ManagedTokenSource>::parse_type_bound_where_clause_item ()
std::vector<std::unique_ptr<AST::TypeParamBound>> type_param_bounds
= parse_type_param_bounds ();
+ Location locus = lexer.peek_token ()->get_locus ();
+
return std::unique_ptr<AST::TypeBoundWhereClauseItem> (
new AST::TypeBoundWhereClauseItem (std::move (for_lifetimes),
std::move (type),
- std::move (type_param_bounds)));
+ std::move (type_param_bounds), locus));
}
// Parses a for lifetimes clause, including the for keyword and angle brackets.