https://issues.dlang.org/show_bug.cgi?id=17642
Issue ID: 17642 Summary: Specify in the documentation for destructors the problem with the error InvalidMemoryOperationError Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dlang.org Assignee: nob...@puremagic.com Reporter: criman...@gmail.com The current implementation of GC is not re-enterable so users regularly receive an unexpected InvalidMemoryOperationError. The only reliable way to avoid this error is not to create garbage-collected instances of objects or structs with non-@nogc destructor. There is no information about it in the documentation, except error itself description. Nobody reads all possible errors descriptions before writing code. So then user faced this error usually it's too late to change architecture and think about ~this() @nogc. So I propose to add info about this error and how to avoid this to destructors documentation page https://dlang.org/spec/class.html#destructors or as minimum write a short warning about and give the link to the page with extended info https://wiki.dlang.org/InvalidMemoryOperationError --