aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/checks/errors
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2024-11-19 13:57:34 -0500
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-21 12:32:59 +0100
commit0884ed91a150e10bbdd462724505a7904654cd32 (patch)
tree29832df2c88a7d337f90f9dee13518b4c87dc3e8 /gcc/rust/checks/errors
parentdb17929375470a85584b8aab02ef68edf2616bf9 (diff)
downloadgcc-0884ed91a150e10bbdd462724505a7904654cd32.zip
gcc-0884ed91a150e10bbdd462724505a7904654cd32.tar.gz
gcc-0884ed91a150e10bbdd462724505a7904654cd32.tar.bz2
gccrs: Use nr2.0 in PrivacyReporter
gcc/rust/ChangeLog: * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_for_privacy_violation): Use name resolver 2.0. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/checks/errors')
-rw-r--r--gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
index 3413e5a..dcc768f 100644
--- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
+++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
@@ -127,8 +127,16 @@ PrivacyReporter::check_for_privacy_violation (const NodeId &use_id,
{
NodeId ref_node_id = UNKNOWN_NODEID;
+ if (flag_name_resolution_2_0)
+ {
+ auto &nr_ctx
+ = Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
+
+ if (auto id = nr_ctx.lookup (use_id))
+ ref_node_id = *id;
+ }
// FIXME: Don't assert here - we might be dealing with a type
- if (!resolver.lookup_resolved_name (use_id, &ref_node_id))
+ else if (!resolver.lookup_resolved_name (use_id, &ref_node_id))
resolver.lookup_resolved_type (use_id, &ref_node_id);
// FIXME: Assert here. For now, we return since this causes issues when