'error: component 'clippy' for target {target} is unavailable for download

When using a custom rust-toolchain file with a pinned version

1.59.0

and running cargo clippy in 1.59.0, I get

error: the 'cargo-clippy' binary, normally provided by the 'clippy' component, is not applicable to the '1.59.0-aarch64-apple-darwin' toolchain

How do I fix this?



Solution 1:[1]

This might be due to rustup being corrupted. The surest way to fix this is reinstalling rustup

  • rustup self uninstall
  • Then reinstall it via rustup.rs

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 andrewgazelka