[gcc r17-3064] gccrs: Use late name resolution on extern crates

Arthur Cohen via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:592218806a1805d3189832642a9c7c84686ca039

commit r17-3064-g592218806a1805d3189832642a9c7c84686ca039
Author: Pierre-Emmanuel Patry <[email protected]>
Date:   Fri Jun 26 12:54:03 2026 +0200

    gccrs: Use late name resolution on extern crates
    
    Late name resolution was initially not run on extern crate since the
    content within the functions was not used. But function return type is
    resolved within the late name resolver hence why we cannot skip it.
    
    gcc/rust/ChangeLog:
    
            * rust-session-manager.cc (Session::load_extern_crate): Run late name
            resolver on extern crates.
    
    Signed-off-by: Pierre-Emmanuel Patry <[email protected]>

Diff:
---
 gcc/rust/rust-session-manager.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 64fd8e22139c..e70a981be6b7 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -1326,6 +1326,7 @@ Session::load_extern_crate (const std::string &crate_name, location_t locus)
 
   Resolver2_0::Early early (ctx);
   early.go (parsed_crate);
+  Resolver2_0::Late (ctx).go (parsed_crate);
 
   std::vector<AttributeProcMacro> attribute_macros;
   std::vector<CustomDeriveProcMacro> derive_macros;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.