aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-gcc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
-rw-r--r--gcc/rust/rust-gcc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 398dea1..8f950d17 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -1258,7 +1258,7 @@ constructor_expression (tree type_tree, bool is_variant,
return error_mark_node;
vec<constructor_elt, va_gc> *init;
- vec_alloc (init, vals.size ());
+ vec_alloc (init, union_index != -1 ? 1 : vals.size ());
tree sink = NULL_TREE;
bool is_constant = true;