From 75ec5f4f4879b96afcf6eec70dad81b9c59d4172 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Tue, 4 Apr 2023 11:24:44 +0200 Subject: ast: Fix tokenstream extern block statements The visitor created some additional semicolon between statements in extern blocks, this lead to empty statement. gcc/rust/ChangeLog: * ast/rust-ast-tokenstream.cc (TokenStream::visit): Remove additional semicolon output. * ast/rust-ast-tokenstream.h: Change block visitor prototype with a default value for trailing tokens. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-tokenstream.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gcc/rust/ast/rust-ast-tokenstream.cc') diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc index f965b4d..b947309 100644 --- a/gcc/rust/ast/rust-ast-tokenstream.cc +++ b/gcc/rust/ast/rust-ast-tokenstream.cc @@ -2243,8 +2243,7 @@ TokenStream::visit (ExternBlock &block) Rust::Token::make_string (Location (), std::move (abi))); } - visit_items_as_block (block.get_extern_items (), - {Rust::Token::make (SEMICOLON, Location ())}); + visit_items_as_block (block.get_extern_items ()); } static std::pair -- cgit v1.1