aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r--gcc/rust/backend/rust-compile-context.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-context.h b/gcc/rust/backend/rust-compile-context.h
index d822937..efca267 100644
--- a/gcc/rust/backend/rust-compile-context.h
+++ b/gcc/rust/backend/rust-compile-context.h
@@ -537,6 +537,10 @@ public:
Btype *base_compiled_type
= TyTyResolveCompile::compile (ctx, type.get_base ());
translated = ctx->get_backend ()->reference_type (base_compiled_type);
+ if (!type.is_mutable ())
+ {
+ translated = ctx->get_backend ()->immutable_type (translated);
+ }
}
void visit (TyTy::StrType &type) override