soundness
The guarantee that no safe code can use an API to cause undefined behavior.
A safe function is sound if no sequence of safe calls can trigger undefined behavior through it; an unsound API is a bug even if no current caller misuses it.
Loading interactive…
Examples
pick_two_mut(items, i, j)assertsi != jbefore using raw pointers, so no safe caller can get two&mutto the same item.