aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-02-17 15:41:28 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-02-18 09:08:07 +0100
commit63538444fbce73fff2948e3357939b520f59afb8 (patch)
treee8294499f3a0fdc409b80b40713f7281dac915e2 /gcc/rust/parse/rust-parse-impl.h
parentd120c9db1811752e543ef8c231c1501a63dfcea2 (diff)
downloadgcc-63538444fbce73fff2948e3357939b520f59afb8.zip
gcc-63538444fbce73fff2948e3357939b520f59afb8.tar.gz
gcc-63538444fbce73fff2948e3357939b520f59afb8.tar.bz2
struct-base: Add location info on `..` token
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 8703ecb..445acad 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -14441,6 +14441,7 @@ Parser<ManagedTokenSource>::parse_struct_expr_struct_partial (
AST::StructBase struct_base = AST::StructBase::error ();
if (lexer.peek_token ()->get_id () == DOT_DOT)
{
+ Location dot_dot_location = lexer.peek_token ()->get_locus ();
lexer.skip_token ();
// parse required struct base expr
@@ -14458,7 +14459,8 @@ Parser<ManagedTokenSource>::parse_struct_expr_struct_partial (
// DEBUG:
rust_debug ("struct/enum expr - parsed and validated base expr");
- struct_base = AST::StructBase (std::move (base_expr));
+ struct_base
+ = AST::StructBase (std::move (base_expr), dot_dot_location);
// DEBUG:
rust_debug ("assigned struct base to new struct base ");