aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc10
-rw-r--r--gcc/testsuite/rust/compile/nr2/exclude2
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
index 0c3c9f6..9c9f2cf 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
diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude
index a73b1f0..2e95696 100644
--- a/gcc/testsuite/rust/compile/nr2/exclude
+++ b/gcc/testsuite/rust/compile/nr2/exclude
@@ -145,8 +145,6 @@ parse_complex_generic_application.rs
parse_complex_generic_application2.rs
path_as_generic_arg.rs
pattern-struct.rs
-privacy1.rs
-privacy3.rs
privacy4.rs
privacy5.rs
privacy8.rs