aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-08-02 16:50:26 +0000
committerGitHub <noreply@github.com>2021-08-02 16:50:26 +0000
commitc707190b29e1e5b2d20fa9d68dcd7f043659aed4 (patch)
treecf79d3deafd2361cedb69f6a0757619719077aab /gcc/rust/parse/rust-parse-impl.h
parent2fe7fb7ce537eb967653e04361306e63c21905b7 (diff)
parentcd67e5d5f138dbdff4ec859e4020e8091cb03aa7 (diff)
downloadgcc-c707190b29e1e5b2d20fa9d68dcd7f043659aed4.zip
gcc-c707190b29e1e5b2d20fa9d68dcd7f043659aed4.tar.gz
gcc-c707190b29e1e5b2d20fa9d68dcd7f043659aed4.tar.bz2
Merge #602
602: Add locus to TupleField and pass it and union variants to HIR class r=philberty a=dkm From Mark Wielaard : https://gcc.gnu.org/pipermail/gcc-rust/2021-August/000108.html > TupleField was missing a Location field and we dropped to locus when > lowering Union fields to HIR. Co-authored-by: Mark Wielaard <mark@klomp.org>
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));
}