aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-02-17 16:27:58 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-02-18 09:10:52 +0100
commit425ebda24393eb4f40190228b7ef4b69e6253251 (patch)
tree89c1f6d2a8d74a8392f410c901c5385f5b6bdda0 /gcc/rust/parse/rust-parse-impl.h
parentef06769781a76eaa0de6fb500bebb8473e549f7e (diff)
downloadgcc-425ebda24393eb4f40190228b7ef4b69e6253251.zip
gcc-425ebda24393eb4f40190228b7ef4b69e6253251.tar.gz
gcc-425ebda24393eb4f40190228b7ef4b69e6253251.tar.bz2
type-path-fn: Add location info on start of Fn token
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 3ff1229..c35595c 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -6436,7 +6436,8 @@ Parser<ManagedTokenSource>::parse_type_path_segment ()
}
case LEFT_PAREN: {
// parse type path function
- AST::TypePathFunction type_path_function = parse_type_path_function ();
+ AST::TypePathFunction type_path_function
+ = parse_type_path_function (locus);
if (type_path_function.is_error ())
{
@@ -6462,7 +6463,7 @@ Parser<ManagedTokenSource>::parse_type_path_segment ()
// Parses a function call representation inside a type path.
template <typename ManagedTokenSource>
AST::TypePathFunction
-Parser<ManagedTokenSource>::parse_type_path_function ()
+Parser<ManagedTokenSource>::parse_type_path_function (Location id_location)
{
if (!skip_token (LEFT_PAREN))
{
@@ -6508,7 +6509,8 @@ Parser<ManagedTokenSource>::parse_type_path_function ()
std::unique_ptr<AST::Type> return_type = parse_function_return_type ();
inputs.shrink_to_fit ();
- return AST::TypePathFunction (std::move (inputs), std::move (return_type));
+ return AST::TypePathFunction (std::move (inputs), id_location,
+ std::move (return_type));
}
// Parses a path inside an expression that allows generic arguments.