error: the option `Z` is only accepted on the nightly compiler
阅读原文时间:2023年07月08日阅读:2

问题记录

$ 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

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章