Skip to content

Commit eb1f1c7

Browse files
committed
Resolved item type shall be differentiated later
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]>
1 parent dc06d32 commit eb1f1c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gcc/rust/typecheck/rust-hir-trait-resolve.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ TraitResolver::resolve_path_to_trait (const HIR::TypePath &path,
127127
}
128128
else
129129
{
130-
ok = resolver->lookup_resolved_type (path.get_mappings ().get_nodeid (),
131-
&ref);
130+
auto path_nodeid = path.get_mappings ().get_nodeid ();
131+
ok = resolver->lookup_resolved_type (path_nodeid, &ref)
132+
|| resolver->lookup_resolved_name (path_nodeid, &ref)
133+
|| resolver->lookup_resolved_macro (path_nodeid, &ref);
132134
}
133135

134136
if (!ok)

0 commit comments

Comments
 (0)