A missing item has two safe outcomes
A list holds four items. The program asks for a fifth.
Conceptual list — not a memory layout
AItem 1
BItem 2
CItem 3
DItem 4
—No item 5
Checked lookup
getReturns “none.”
The program can handle the missing item.
Ordinary indexing
Panics.
Execution is interrupted rather than reading beyond the list.
These protections apply while software runs. Ownership and lifetime rules also reject invalid uses of references before execution. Unsafe operations and connections to C/C++ still require developers to uphold memory-safety rules.