diff options
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r-- | gcc/rust/backend/rust-compile-context.h | 5 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-type.cc | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h index a446388..ce81a1d 100644 --- a/gcc/rust/backend/rust-compile-context.h +++ b/gcc/rust/backend/rust-compile-context.h @@ -72,7 +72,10 @@ public: return it->second; compiled_type_map.insert ({h, type}); - push_type (type); + + if (TYPE_NAME (type) != NULL) + push_type (type); + return type; } diff --git a/gcc/rust/backend/rust-compile-type.cc b/gcc/rust/backend/rust-compile-type.cc index 813e11c..83e5756 100644 --- a/gcc/rust/backend/rust-compile-type.cc +++ b/gcc/rust/backend/rust-compile-type.cc @@ -481,6 +481,8 @@ TyTyResolveCompile::visit (const TyTy::ArrayType &type) tree folded_capacity_expr = fold_expr (capacity_expr); translated = Backend::array_type (element_type, folded_capacity_expr); + if (translated != error_mark_node) + translated = ctx->insert_compiled_type (translated); } void |