"If it compiles it works" isn't true. But "If it compiles it won't eat your homework" sort of is.
Rust programs can't know what you want to do, period.
Soundness does not cover semantic correctness. Maybe you want to wipe $HOME.
It depends on what you mean by "freed". Can one write a custom allocator in Rust? How does one handle reading from special addresses that represent hardware? In both of these scenarios, one might read from or write to memory that is not obviously allocated.
https://qouteall.fun/qouteall-blog/2025/How%20to%20Avoid%20F...