我在使用macOS Mojave。我过去使用过Rust,而rustfmt一直有效,但是我无法再下载rustfmt。
$ rustup show
Default host: x86_64-apple-darwin
stable-x86_64-apple-darwin (default)
rustc 1.32.0 (9fda7c223 2019-01-16)
$ rustup component add rustfmt
error: toolchain 'stable-x86_64-apple-darwin' does not contain component 'rustfmt' for target 'x86_64-apple-darwin'
我还需要执行其他命令吗?
答案 0 :(得分:0)
您可以尝试以下命令:
rustup toolchain remove stable && rustup toolchain add stable
OR
rustup toolchain remove stable && rustup toolchain install stable
在编译器版本更新后的某些情况下,它可以提供帮助,例如 rustfmt , clippy 或其他Rust组件。