That is a runtime check similar to RefCell::borrow() panic if you try to read from it while something else is mutating it.
With two important differences:
(0) RefCell can't be used in a multithreaded context. You have to use an actual Mutex.
(1) ConcurrentModificationException isn't reliable. It's thrown on a best-effort basis.
In any case, in a high-level language, just memory-safety is a very cheap guarantee. You also want to protect the internal invariants of your data structures - especially the concurrent ones!
ConcurrentModificationException.