What changes are necessary to make rustup.sh handle sudo itself?

I don’t think running with -y should turn of sudo-ing. The correct way to do is to require the least needed privileges: So only the installation phase (e.g. copy distributables) should require sudo at all, iff the user does not have write access to the target directories.

A user could be installing Rust into a ~/bin, ~/lib, etc. directory, which should not sudo anything.