On Tuesday, 13 March 2018 at 21:07:33 UTC, ag0aep6g wrote:
You're storing a reference to `small` in `data`. When a SmallString is copied, that reference will still point to the original `small`. When the original goes out of scope, the reference becomes invalid, a dangling pointer. Can't have those in @safe code.

The error message isn't exactly clear, though.

The error does not go away when restoring these lines:

    @disable this(this);
    @disable void opAssign(this);

Reply via email to