The problem isn't the language here, it's cargo executing build.rs from dependencies which necessarily allows arbitrary code execution.
Then the problem is the language, as the grandparent observes.
It's like if `git clone` ran random stuff from the cloned repo.