相关疑难解决方法(0)

如何在 Rust 工具链之间切换?

rustup help toolchain 列出以下子命令

SUBCOMMANDS:
    list         List installed toolchains
    install      Install or update a given toolchain
    uninstall    Uninstall a toolchain
    link         Create a custom toolchain by symlinking to a directory
    help         Prints this message or the help of the given subcommand(s)
Run Code Online (Sandbox Code Playgroud)

我安装了以下工具链

stable-x86_64-unknown-linux-gnu (default)
nightly-2019-09-05-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
master
Run Code Online (Sandbox Code Playgroud)

我试图解决 rust-clippy 的问题,所以我不得不安装主工具链。尽管将稳定设置为我的默认工具链,但我当前的工具链是主工具链,我想切换回稳定。如何在不卸载主工具链的情况下执行此操作?

没有 switch 子命令吗?

rust rustup

36
推荐指数
4
解决办法
2万
查看次数

如何使用Rustup删除Rust编译器工具链?

Rustup文档显示了如何每晚安装Rust,但不知道如何删除它.

虽然文档确实显示了如何rustup完全卸载,但我想保留稳定的分支.

我怎么能每晚卸载Rust?


请注意,我尝试与rustup install nightly...(rustup uninstall nightly,rustup remove nightly&rustup delete nightly)相反,但没有用.

即使我阅读文档,也不清楚nightly是a toolchain,a channel......还是别的什么.

rust rustup

16
推荐指数
2
解决办法
4847
查看次数

如何使用夜间通道进行货物测试?

我正在尝试使用Windows Powershell每晚使用Rust运行我的测试.我cargo test在目录中运行,我得到了

Compiling rustcraft v0.1.0 (file:///C:/Users/Phoenix/Desktop/Rust/rustcraft)
error[E0554]: #![feature] may not be used on the stable release channel
 --> C:\Users\Phoenix\Desktop\Rust\rustcraft\src\main.rs:1:1
  |
1 | #![feature(integer_atomics)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel
 --> C:\Users\Phoenix\Desktop\Rust\rustcraft\src\main.rs:2:1
  |
2 | #![feature(collections)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)

显然,我必须告诉Cargo在夜间频道编译它,但是怎么样?我找不到在帮助部分或我找到的任何网站中指定频道的任何参考.

rust rust-cargo

12
推荐指数
2
解决办法
9681
查看次数

如何为特定的rustup工具链安装Rust目标?

我在64位Windows计算机上使用rustccargo在其中编译32位应用程序。在使用稳定的工具链时,此方法可以很好地工作,但是当我尝试使用beta工具链时,它将失败。

Beta版工具链已成功安装rustup install beta。在项目文件夹中,有一个.cargo/config包含以下行的文件:

[build]
target = "i686-pc-windows-msvc"

[target.i686-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static"]
Run Code Online (Sandbox Code Playgroud)

运行cargo +beta build时发生以下错误:

[build]
target = "i686-pc-windows-msvc"

[target.i686-pc-windows-msvc]
rustflags = ["-Ctarget-feature=+crt-static"]
Run Code Online (Sandbox Code Playgroud)

我试图运行rustup target add i686-pc-windows-msvc以解决此问题,但没有帮助;rustup target list甚至显示为“已安装”。可能此命令仅添加稳定目标,而我找不到如何指定beta工具链。

如何为Beta工具链添加另一个(非默认)目标?

cross-compiling rust

3
推荐指数
1
解决办法
3340
查看次数

标签 统计

rust ×4

rustup ×2

cross-compiling ×1

rust-cargo ×1