]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Fix tokenstream function body
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 17 Apr 2023 16:04:41 +0000 (18:04 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:09 +0000 (18:34 +0100)
Function body were skipped in tokenstream when no return type was
provided.

gcc/rust/ChangeLog:

* ast/rust-ast-tokenstream.cc (TokenStream::visit_function_common):
Fix function body output.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-tokenstream.cc

index 78b53852658f0f3556109f313424c0011463b134..67b122a90891642f11b3e70f591c8b1b188cc48d 100644 (file)
@@ -1978,10 +1978,7 @@ TokenStream::visit_function_common (std::unique_ptr<Type> &return_type,
 
   if (block)
     {
-      if (return_type)
-       {
-         visit (block);
-       }
+      visit (block);
     }
   else
     {