> What's unsafe is dereferencing the pointers they produce. While technically correct, that is a dangerous path to safety: type Obj = object a: array[3, int] b: int var x: Obj let theEnd = addr(x.a[3]) # safe by Rust's definition? # unsafe by Nim's! theEnd[] = 4 # unsafe: stores into x.b! Run
If you seek to detect these invalid derefs at runtime, be prepared for a harder time with Rust's notion of safety.