So I am trying to build a rust project using cargo build
and receive:
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -C -Zshare-generics=y -Csplit-debuginfo=unpacked --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: unknown codegen option: `-Zshare-generics`
I tried multiple projects, non of them worked. So tried creating a new one. Still didn't work. Removed the config file and still nothing.
My cargo version is cargo 1.66.1 (ad779e08b 2023-01-10)
and rustc rustc 1.66.1 (90743e729 2023-01-10)
. Tried uninstalling rust (rustup self uninstall
and rm -rf $HOME/.cargo
) and reinstalling but still get the error.
$ rustup show
Default host: x86_64-apple-darwin
rustup home: /Users/USER/.rustup
stable-x86_64-apple-darwin (default)
rustc 1.66.1 (90743e729 2023-01-10)
I tried creating a new project after the reinstall. Still nothing so any help is appreciated.