Use `std.exception.assertThrown!RangeError`.