aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-tokenstream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-ast-tokenstream.cc')
-rw-r--r--gcc/rust/ast/rust-ast-tokenstream.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc
index 8c54141..cdfd870 100644
--- a/gcc/rust/ast/rust-ast-tokenstream.cc
+++ b/gcc/rust/ast/rust-ast-tokenstream.cc
@@ -1111,11 +1111,6 @@ void
TokenStream::visit (StructExprStruct &expr)
{
visit (expr.get_struct_name ());
- tokens.push_back (Rust::Token::make (LEFT_CURLY, expr.get_locus ()));
- // FIXME: Reference says it should have fields but node doesn't have them for
- // now. We need to disambiguate with StructExprUnit and visit fields.
- gcc_unreachable ();
- tokens.push_back (Rust::Token::make (RIGHT_CURLY, Location ()));
}
void
@@ -1161,6 +1156,8 @@ TokenStream::visit (StructBase &base)
void
TokenStream::visit (StructExprStructFields &expr)
{
+ visit (expr.get_struct_name ());
+ tokens.push_back (Rust::Token::make (LEFT_CURLY, expr.get_locus ()));
visit_items_joined_by_separator (expr.get_fields (), COMMA);
if (expr.has_struct_base ())
{
@@ -1171,6 +1168,7 @@ TokenStream::visit (StructExprStructFields &expr)
{
trailing_comma ();
}
+ tokens.push_back (Rust::Token::make (RIGHT_CURLY, expr.get_locus ()));
}
void