https://gcc.gnu.org/g:2ede4ecdee9e806008ab9bd836be4714c49b8902

commit r17-1874-g2ede4ecdee9e806008ab9bd836be4714c49b8902
Author: Arthur Cohen <[email protected]>
Date:   Wed Apr 22 09:47:43 2026 +0200

    gccrs: marklive: Allow looking up variables in types NS as well
    
    gcc/rust/ChangeLog:
    
            * checks/lints/rust-lint-marklive.cc 
(MarkLive::find_value_definition): Use Types NS
            alongside Values NS for lookup.

Diff:
---
 gcc/rust/checks/lints/rust-lint-marklive.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/rust/checks/lints/rust-lint-marklive.cc 
b/gcc/rust/checks/lints/rust-lint-marklive.cc
index 1ef35f328cbd..3998cb70f08f 100644
--- a/gcc/rust/checks/lints/rust-lint-marklive.cc
+++ b/gcc/rust/checks/lints/rust-lint-marklive.cc
@@ -269,9 +269,11 @@ MarkLive::mark_hir_id (HirId id)
 void
 MarkLive::find_value_definition (NodeId ast_node_id, NodeId &ref_node_id)
 {
-  auto resolved = resolver.lookup (ast_node_id, 
Resolver2_0::Namespace::Values);
+  auto resolved = resolver.lookup (ast_node_id, Resolver2_0::Namespace::Values,
+                                  Resolver2_0::Namespace::Types);
   rust_assert (resolved.has_value ());
-  ref_node_id = resolved.value ();
+
+  ref_node_id = resolved->id;
 }
 
 } // namespace Analysis

Reply via email to