Closed jyn514 closed 1 year ago
I just checked and rustup prevents you from naming custom toolchains things that could be a version number:
$ rustup toolchain link 1.52.0 /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: '1.52.0-x86_64-unknown-linux-gnu'
$ rustup toolchain link beta /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: 'beta-x86_64-unknown-linux-gnu'
$ rustup toolchain link stable /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: 'stable-x86_64-unknown-linux-gnu'
$ rustup toolchain link nightly /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: 'nightly-x86_64-unknown-linux-gnu'
So it should be possible to tell if toolchains are custom by seeing if they match \d+\.\d+(:?\.\d+).*
or stable/beta/nightly or not.
I installed a custom version of rust from source (with x.py) and then cleaned the target directory. Now
cargo sweep -i
doesn't work. Instead of giving a hard error, it should just skip custom toolchains and continue sweeping all others.