Skip to content
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

error: Unrecognized option: 'fix' in workspace #9398

Closed
bjeanes opened this issue Aug 30, 2022 · 2 comments
Closed

error: Unrecognized option: 'fix' in workspace #9398

bjeanes opened this issue Aug 30, 2022 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@bjeanes
Copy link

bjeanes commented Aug 30, 2022

Summary

I learned of the --fix option from --help but when trying it, it says unrecognized option 🤨

❯ cargo clippy --fix
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/Users/bjeanes/.rustup/toolchains/stable-aarch64-apple-darwin/bin/clippy-driver rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
  --- stderr
  error: Unrecognized option: 'fix'

I can't seem to find anything which seems to be the same issue. #2765 looks similar but there is no custom wrapper here, that I am aware of:

❯ file `which rustc`                  
/Users/bjeanes/.cargo/bin/rustc: Mach-O 64-bit executable arm64

Rust and cargo are installed with rustup, so as far as I know it's a pretty standard setup.

However, I tried it on another project and it worked fine. The only practical difference appears to be that the project in which clippy --fix fails is a workspace with 3 crates: https://github.com/bjeanes/modbus-mqtt

Reproducer

No response

Version

rustc 1.63.0 (4b91a6ea7 2022-08-08)
binary: rustc
commit-hash: 4b91a6ea7258a947e59c6522cd5898e7c0a6a88f
commit-date: 2022-08-08
host: aarch64-apple-darwin
release: 1.63.0
LLVM version: 14.0.5

Additional Labels

No response

@bjeanes bjeanes added the C-bug Category: Clippy is not doing the correct thing label Aug 30, 2022
@bjeanes
Copy link
Author

bjeanes commented Aug 30, 2022

Huh, weird. Simply cargo build and then cargo clippy --fix worked again. I'm not sure what it was caching but it must have been user error on my part somewhere...

@bjeanes bjeanes closed this as completed Aug 30, 2022
@johnnybenson
Copy link

Huh, weird. Simply cargo build and then cargo clippy --fix worked again. I'm not sure what it was caching but it must have been user error on my part somewhere...

Just encountered the same issue, the above resolved it for me too. Thanks for posting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

No branches or pull requests

2 participants