Comment #0 by verylonglogin.reg — 2013-05-20T04:38:29Z
---
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
}
---
Comment #1 by verylonglogin.reg — 2013-05-20T04:53:15Z
Looks like Issue 10124 have to be fixed first.
Comment #2 by b2.temp — 2019-03-30T12:12:56Z
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.