-
Notifications
You must be signed in to change notification settings - Fork 927
cargo install rustfmt-nightly fails with binary already exists, but cargo fmt says toolchain doesn't have binary #2304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Distribution via rustup is in the early stage, and likely to cause some annoyance. When using |
@topecongiro Yep, that solved it, thank you! Although it now broke my VS Code Rust (RLS) extension (can't install new component |
I had this issue again today, solved it by adding '--force' to the install command. |
Here's the answer mbrubeck gave me on IRC:
This means the component is managed by rustup as intended. |
rustfmt stopped working for me. It turns out people started having trouble with this last year already rust-lang/rustfmt#2304
* rustfmt install instruction gotcha rustfmt stopped working for me. It turns out people started having trouble with this last year already rust-lang/rustfmt#2304 * rustfmt on a single file now works! Secrets inside After `rustup component add rustfmt-preview` I get rustfmt as a command in my terminal. `rustfmt --help` reveals --write-mode [replace|overwrite|display|plain|diff|coverage|checkstyle] and we've been using the default which is either `overwrite` or `replace` (depending on rustfmt version) and this was changing a bunch of files and a messed up workflow. * Newcomer-friendly explanation how to use `rustfmt`
My issue on Linux with rustup and xargo installed but not working was that ~/.cargo/bin wasn't in the PATH, seems to be working now. |
I didn't know TIL |
Nope... Like @topecongiro said:
Right now even after Rust 2018 edition was released, there is no |
Uh oh!
There was an error while loading. Please reload this page.
I have installed Rust using Rustup and didn't do any configuration aside from creating a binary Rust repository and switching the toolchain to nightly for Clippy using
rustup override set
.rustup show
:When doing
cargo install rustfmt-nightly
I get error: binarycargo-fmt
already exists in destination. Okay, I figured Rustup installed Rustfmt as a part of the toolchain. Also, I had a previously pre-Rustup Rust installation which Rustup prompted me to uninstall before I do use Rustup and that's what I did, using the command suggested I use for this by Rustup. Mayberustfmt
existed previously and wasn't removed by the uninstaller?But when doing
cargo fmt
I get rror: toolchain 'nightly-x86_64-apple-darwin' does not have the binarycargo-fmt
. I triedcargo rustfmt
,cargo rustfmt-nightly
,rustfmt
andrustfmt-nightly
as well and neither succeeded.I proceeded to force install Rustfmt again:
cargo install rustfmt-nightly --force
but that failed on me. Here's a selection of the errors:GenericParam
inast
initems.rs:1875:19
params
on type&syntax::ast::Generics
initems.rs:1872:10
syntax::ast::WhereBoundPredicate
does not have a field namedbound_generic_params
intypes.rs:416:17
As shown previously, I am running on the nightly toolchain so I am not sure why the installation would fail.
I also
cargo install rustfmt
and that worked and replaced the borked installation ofrustfmt-nightly
, but obviously this version is deprecated and I always have to pass--force
to it so I'd rather userustfmt-nightly
. But it works so that's a good start.I tried to re-force-install
rustfmt-nightly
once more just in case after successful installation ofrustfmt
the original failure cause went away but it didn't.Could someone please guide me in how to debug this issue? I am pretty sure I am compiling
rustfmt-nightly
with a nightly build, so that should not be a problem and I am surprised to see it failing on build and not installation.The text was updated successfully, but these errors were encountered: