From a66dd96413432095ef13e6429f7acb3cb06f4f0f Mon Sep 17 00:00:00 2001 From: Nirmal Patel Date: Fri, 29 Oct 2021 14:27:50 -0400 Subject: Add location info in AST::TypeBoundWhereClauseItem and HIR::TypeBoundWhereClauseItem 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 --- gcc/rust/parse/rust-parse-impl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/rust/parse/rust-parse-impl.h') 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::parse_type_bound_where_clause_item () std::vector> type_param_bounds = parse_type_param_bounds (); + Location locus = lexer.peek_token ()->get_locus (); + return std::unique_ptr ( 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. -- cgit v1.1