[gcc/devel/rust/master] Visit function return type in default resolver

Thomas Schwinge tschwinge@gcc.gnu.org
Tue May 7 16:27:02 GMT 2024


https://gcc.gnu.org/g:e84d67febe5805675d3f86e0e535702dfe67b78d

commit e84d67febe5805675d3f86e0e535702dfe67b78d
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Jan 24 16:47:50 2024 +0100

    Visit function return type in default resolver
    
    Function return type was not properly visited in the default resolver
    visitor pattern.
    
    gcc/rust/ChangeLog:
    
            * resolve/rust-default-resolver.cc (DefaultResolver::visit): Visit
            function return type.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>

Diff:
---
 gcc/rust/resolve/rust-default-resolver.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/rust/resolve/rust-default-resolver.cc b/gcc/rust/resolve/rust-default-resolver.cc
index e2609d13c9a6..d805bc9a511d 100644
--- a/gcc/rust/resolve/rust-default-resolver.cc
+++ b/gcc/rust/resolve/rust-default-resolver.cc
@@ -79,6 +79,9 @@ DefaultResolver::visit (AST::Function &function)
 	  }
       }
 
+    if (function.has_return_type ())
+      visit (function.get_return_type ());
+
     if (function.has_body ())
       function.get_definition ().value ()->accept_vis (*this);
   };


More information about the Gcc-cvs mailing list