aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-01-24 17:10:42 +0100
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2024-03-26 17:35:02 +0000
commit01f3f7b846504858c43a5d94b9d60109369648e1 (patch)
treefd4b907ef28302e877bf66a0d2106e5ac5e1efd8 /gcc
parent08a6f1a1183572b35e5151f2b73b1aec41d42db2 (diff)
downloadgcc-01f3f7b846504858c43a5d94b9d60109369648e1.zip
gcc-01f3f7b846504858c43a5d94b9d60109369648e1.tar.gz
gcc-01f3f7b846504858c43a5d94b9d60109369648e1.tar.bz2
Struct are types, not values
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>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/typecheck/rust-hir-type-check-item.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/rust/typecheck/rust-hir-type-check-item.cc b/gcc/rust/typecheck/rust-hir-type-check-item.cc
index 4ab946e..3e504e5 100644
--- a/gcc/rust/typecheck/rust-hir-type-check-item.cc
+++ b/gcc/rust/typecheck/rust-hir-type-check-item.cc
@@ -279,9 +279,11 @@ TypeCheckItem::visit (HIR::StructStruct &struct_decl)
{
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