Earlier quoted context omitted.
You're describing the desired behavior of the compiler, but not what it actually implements. In fact there are an infinite number of correct Rust programs which will never access memory incorrectly but which will still be rejected by the compiler, for the simple reason that Rust's authors, talented though they may be, have made no progress at all at solving the Halting Problem. What Rust actually accepts is a subset…
No, the rule I stated is what is actually implemented. Like all type checking technology, the rule is about static behavior, not dynamic behavior. So halting problem is irrelevant. Rust accepts all programs that follow the rule in static behavior. It's not a subset, and it's not a best effort to prove. It's the complete statement. "Access" means source code construct to read or write. Rust doesn't care whether the co…
let (left, right) = (&mut foo[..split], &mut foo[split..]);
where you have to rely on things like foo.split_at_mut(split), which are implemented as unsafe under the cover.I see these are limitations but not show-stoppers in any way.