We shall search in the right namespace. The correct namespace for struct
is type namespace.
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Change
search location for struct types.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
{
auto nr_ctx
= Resolver2_0::ImmutableNameResolutionContext::get ().resolver ();
- auto canonical_path = nr_ctx.values.to_canonical_path (
+ auto canonical_path = nr_ctx.types.to_canonical_path (
struct_decl.get_mappings ().get_nodeid ());
+ if (!canonical_path.has_value ())
+ rust_unreachable ();
path = canonical_path.value ();
}
else