]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: unsafe: Lookup PathInExpression nodes in both the Types and Values NS.
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 3 Jun 2026 09:29:56 +0000 (11:29 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 25 Jun 2026 17:21:29 +0000 (19:21 +0200)
gcc/rust/ChangeLog:

* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Add Types as a
namespace in which to lookup PathInExpressions.

gcc/rust/checks/errors/rust-unsafe-checker.cc

index da4530ab2587b66802a6c103656e6b2a27e9869a..379cd4c9a38190fecf8ecd22b8b9ac653a560d12 100644 (file)
@@ -222,8 +222,9 @@ UnsafeChecker::visit (PathInExpression &path)
   NodeId ref_node_id;
 
   if (auto resolved
-      = resolver.lookup (ast_node_id, Resolver2_0::Namespace::Values))
-    ref_node_id = resolved.value ();
+      = resolver.lookup (ast_node_id, Resolver2_0::Namespace::Values,
+                        Resolver2_0::Namespace::Types))
+    ref_node_id = resolved->id;
   else
     return;