As I pointed out in issue# 14773, the druntime unit tests are unfortunately only run in non-release mode right now, so stuff like range violations in the tests typically aren't caught. One of the tests that fails with a range violations if you build druntime without -release is this the one currently on line# 861 in src/rt/aaA.d:
unittest
{
alias E = void[0];
auto aa = [E.init : E.init];
assert(aa.length == 1);
assert(aa.byKey.front == E.init);
assert(aa.byValue.front == E.init);
aa[E.init] = E.init; // This test here fails
assert(aa.length == 1);
assert(aa.remove(E.init));
assert(aa.length == 0);
}
So, if you either edit the makefile to build without -release or mark the unittest block with @safe and comment out the lines calling byKey.front and byValue.front (since those aren't @safe or @trusted apparently), then you will see line# 861 fail with a range violation.