The same idea as how you can know a Rust program is memory safe.
You look for any unsafe blocks, and then run the type checker.