简体   繁体   English

如何在Rust 1.32发行版中安装rustfmt?

[英]How to install rustfmt with the release of Rust 1.32?

I'm on macOS Mojave. 我在macOS Mojave上。 I've used Rust in the past and rustfmt has always worked, but I can no longer download rustfmt. 我过去使用过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'

Is there some other command that I need to execute? 我还需要执行其他命令吗?

You can try these commands: 您可以尝试以下命令:

rustup toolchain remove stable && rustup toolchain add stable

OR 要么

rustup toolchain remove stable && rustup toolchain install stable

It can help in several cases after compiler version updates, like rustfmt , clippy , or other Rust components. 在编译器版本更新后的某些情况下,它可以提供帮助,例如rustfmtclippy或其他Rust组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM