aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2021-08-02 00:33:02 +0200
committerMark Wielaard <mark@klomp.org>2021-08-02 00:33:08 +0200
commitcd67e5d5f138dbdff4ec859e4020e8091cb03aa7 (patch)
tree21fbf1574ca5be1da5802f60820661d35167183c /gcc/rust/parse/rust-parse-impl.h
parent389fd74a3f3e9422a965263b6961b51295c55976 (diff)
downloadgcc-cd67e5d5f138dbdff4ec859e4020e8091cb03aa7.zip
gcc-cd67e5d5f138dbdff4ec859e4020e8091cb03aa7.tar.gz
gcc-cd67e5d5f138dbdff4ec859e4020e8091cb03aa7.tar.bz2
Add locus to TupleField and pass it and union variants to HIR class
TupleField was missing a Location field and we dropped to locus when lowering Union fields to HIR.
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 122a3c3..9eb212b 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -4295,6 +4295,8 @@ Parser<ManagedTokenSource>::parse_tuple_field ()
// parse visibility if it exists
AST::Visibility vis = parse_visibility ();
+ Location locus = lexer.peek_token ()->get_locus ();
+
// parse type, which is required
std::unique_ptr<AST::Type> field_type = parse_type ();
if (field_type == nullptr)
@@ -4308,7 +4310,7 @@ Parser<ManagedTokenSource>::parse_tuple_field ()
return AST::TupleField::create_error ();
}
- return AST::TupleField (std::move (field_type), std::move (vis),
+ return AST::TupleField (std::move (field_type), std::move (vis), locus,
std::move (outer_attrs));
}