You don't have a 100% guarantee if unsafe is being used.
Some languages get a lot closer than others, though -- I think Elm, Rust, Haskell, and so on are still a big improvement over the status quo of languages. I'd rather get 90% of the way there than 10%.
Also, even in unsafe code, Rust offers more guarantees than many (most?) languages.