https://gcc.gnu.org/g:783fd81c789dfe157b74d9d11a0ee23bdb372404

commit r17-1875-g783fd81c789dfe157b74d9d11a0ee23bdb372404
Author: Arthur Cohen <[email protected]>
Date:   Fri Apr 24 17:20:58 2026 +0200

    gccrs: nr2.0: Fix resolve_path_in_all_ns
    
    gcc/rust/ChangeLog:
    
            * resolve/rust-early-name-resolver-2.0.h: Properly insert 
resolutions in
            the returned vector as that was previously missing.

Diff:
---
 gcc/rust/resolve/rust-early-name-resolver-2.0.h | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.h 
b/gcc/rust/resolve/rust-early-name-resolver-2.0.h
index 7b1e377220d7..235595e8d01f 100644
--- a/gcc/rust/resolve/rust-early-name-resolver-2.0.h
+++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.h
@@ -232,9 +232,14 @@ private:
     std::vector<Error> type_errors;
     std::vector<Error> macro_errors;
 
-    ctx.resolve_path (path, value_errors, Namespace::Values);
-    ctx.resolve_path (path, type_errors, Namespace::Types);
-    ctx.resolve_path (path, macro_errors, Namespace::Macros);
+    auto resolved_fn
+      = [&resolved] (NameResolutionContext::NamespacedDefinition new_def) {
+         resolved.emplace_back (new_def);
+       };
+
+    ctx.resolve_path (path, value_errors, Namespace::Values).map (resolved_fn);
+    ctx.resolve_path (path, type_errors, Namespace::Types).map (resolved_fn);
+    ctx.resolve_path (path, macro_errors, Namespace::Macros).map (resolved_fn);
 
     if (!value_errors.empty () && !type_errors.empty ()
        && !macro_errors.empty ())

Reply via email to