From: Arthur Cohen Date: Wed, 22 Apr 2026 07:47:43 +0000 (+0200) Subject: gccrs: marklive: Allow looking up variables in types NS as well X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ede4ecdee9e806008ab9bd836be4714c49b8902;p=thirdparty%2Fgcc.git 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 --git a/gcc/rust/checks/lints/rust-lint-marklive.cc b/gcc/rust/checks/lints/rust-lint-marklive.cc index 1ef35f328cb..3998cb70f08 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