From cd67e5d5f138dbdff4ec859e4020e8091cb03aa7 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 2 Aug 2021 00:33:02 +0200 Subject: 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. --- 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 122a3c3..9eb212b 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -4295,6 +4295,8 @@ Parser::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 field_type = parse_type (); if (field_type == nullptr) @@ -4308,7 +4310,7 @@ Parser::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)); } -- cgit v1.1