Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nr2.0 in PrivacyReporter #3252

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions gcc/testsuite/rust/compile/nr2/exclude
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading