--- struct S { @disable this(); } void main() { S[] arr = [S.init, S.init, S.init]; --arr.length; // Error: struct main.S default construction is disabled arr.length -= 1; // Same error size_t n = 1; arr.length -= n; // Same error } ---
Looks like Issue 10124 have to be fixed first.
I don't think this is a valid issue. When an array is shrink, its memory might be copied to another location. a struct with self reference would then become unsafe. You cannot speculate on the implementation details of the GC allocator.