error: the option `Z` is only accepted on the nightly compiler

问题记录

$ cargo expand
     Checking helo v0.1.0 (/Users/Buzz/Documents/git/rust-lang/hello)
error: the option `Z` is only accepted on the nightly compiler
error: could not compile `hello`

解决:切换到nightly版本

# Install nightly toolchain:
rustup install nightly

# Switch to nightly toolchain
rustup override set nightly

其它相关指令

# Show the defautl toolchain
rustup default

# Set the default toolchain to the latest nightly
rustup default nightly

# Set the default toolchain to the latest stable
rustup default stable

# To use to a specific nightly for a directory:
rustup override set nightly-2014-12-18

# Or a specific stable release:
rustup override set 1.0.0

# To see the active toolchain
rustup show

# To remove the override and use the default toolchain again, 
rustup override unset

参考

https://rust-lang.github.io/rustup/overrides.html

posted @ 2022-10-23 14:14  BuzzWeek  阅读(498)  评论(0编辑  收藏  举报