There is that
-----
version(RBDoChecks)
check();
-----
code in every meaningful operation, and a
-----
version(unittest) version = RBDoChecks;
-----
line at the top of std/container.d (line 217).
Still, one can wish to run unit tests of one's own code, not check the integrity of the library container.
I suggest to remove the -unittest => RBDoChecks implication, possibly mentioning RBDoChecks at the top of RedBlackTree documentation.
As an update here, I don't disagree there is a problem. But I disagree with the solution. Disabling the checks during unit tests means disabling them during Phobos unit tests.
I don't think we should do this. I'd rather fix the problem of running unit tests for templates by default.
I'll leave the bug open, because it's still a bug.
Comment #3 by bugzilla — 2021-05-03T16:54:11Z
Meanwhile this has been replaced by
version (StdUnittest) debug = RBDoChecks;
As far as I understand it, this has fixed the problem...