aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.h')
-rw-r--r--gcc/rust/backend/rust-compile-expr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index 86d4062..b48d79e 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -225,6 +225,14 @@ public:
}
return;
+ case HIR::Literal::STRING: {
+ auto base = ctx->get_backend ()->string_constant_expression (
+ literal_value->as_string ());
+ translated
+ = ctx->get_backend ()->address_expression (base, expr.get_locus ());
+ }
+ return;
+
default:
rust_fatal_error (expr.get_locus (), "unknown literal");
return;