Skip to content

Commit

Permalink
Use nr2.0 in PrivacyReporter
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
powerboat9 committed Nov 19, 2024
1 parent 41a1247 commit b4db982
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit b4db982

Please sign in to comment.