From: Arthur Cohen <[email protected]>

gcc/rust/ChangeLog:

        * checks/lints/rust-lint-marklive.cc (MarkLive::find_value_definition): 
Use Types NS
        alongside Values NS for lookup.
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/22aa69588dcf76e5de8b66accf4c6d359ff1bc86

The commit has NOT been mentioned in any issue.

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4551

 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 1ef35f328..3998cb70f 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
-- 
2.54.0

Reply via email to