Skip to content

Commit

Permalink
Resolved item type shall be differentiated later
Browse files Browse the repository at this point in the history
We need to query all namespaces and error out at a later stage if the
retrieved item is wrong.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait):
	Query all namespaces.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
  • Loading branch information
P-E-P committed Jan 6, 2025
1 parent dc06d32 commit eb1f1c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gcc/rust/typecheck/rust-hir-trait-resolve.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ TraitResolver::resolve_path_to_trait (const HIR::TypePath &path,
}
else
{
ok = resolver->lookup_resolved_type (path.get_mappings ().get_nodeid (),
&ref);
auto path_nodeid = path.get_mappings ().get_nodeid ();
ok = resolver->lookup_resolved_type (path_nodeid, &ref)
|| resolver->lookup_resolved_name (path_nodeid, &ref)
|| resolver->lookup_resolved_macro (path_nodeid, &ref);
}

if (!ok)
Expand Down

0 comments on commit eb1f1c7

Please sign in to comment.