diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h index 8766759cc41..0de19321050 100644 --- a/src/rt/rust_shape.h +++ b/src/rt/rust_shape.h @@ -923,7 +923,9 @@ public: void walk_fixedvec1(uint16_t n_elts, bool is_pod) { size_align sa = size_of::get(*this); ALIGN_TO(sa.alignment); + U next_dp = dp + (n_elts * sa.size); static_cast(this)->walk_fixedvec2(n_elts, sa.size, is_pod); + dp = next_dp; } void walk_box1() { DATA_SIMPLE(void *, walk_box2()); } diff --git a/src/test/run-pass/fixed_length_vec_glue.rs b/src/test/run-pass/fixed_length_vec_glue.rs new file mode 100644 index 00000000000..b8d894bef7d --- /dev/null +++ b/src/test/run-pass/fixed_length_vec_glue.rs @@ -0,0 +1,6 @@ +fn main() { + let arr = [1,2,3]/3; + let struct = {a: 13u8, b: arr, c: 42}; + let s = sys::log_str(struct); + assert(s == "(13, [1, 2, 3]/3, 42)"); +}