I am new to Rust and I've run into a problem with rustup for the first time.
The point is that it doesn't allow me to use unstable feature of the language although I explicitly run it with nightly modifier rustup run nightly cargo build -Z build-std=core --target <Target>
I have already tried
rustup override set nightly
and
rustup default nightly
It changes config in ~/.rustup/settings.toml but does nothing when i am trying to use [unstable] or -Z I will still get this error:
error: the -Zflag is only accepted on the nightly channel of Cargo, but this is thestable channel
Or different errors (in case of [unstable] in .cargo/config) which signal that stable channel is used instead of nightly
Big thanks to everyone, who tried to help me with this issue. I had a $PATH overwritten in my .bashrc to expose rust stable version for VSCode to use it in rust-analyzer plugin, so every call to cargo or rustc proxied to stable version, that were exposed in $PATH, after removing it rustup works as expected. But I still have to manage the way to make my VSCode rust-analyzer plugin work again without Rust explicitly exposed in $PATH variable)