See this example for Scala:
https://blog.tmorris.net/posts/scala-exercise-with-types-and-abstraction/index.html
Now go further and say you can't compile a call that leaks memory, or things like that.
Disclaimer: I don't know Rust so can't verify the claim. All I can say is it sounds somewhat plausible.