我错误地将 RUST 安装在我的“src”树中。它有效,但我想将其移动到本地 AppData 目录下的某个位置,例如“%LOCALAPPDATA%\Rust”或“%LOCALAPPDATA%\Rust\Stable”。我看不到“rustup”的“self”或“update”选项在哪里可以选择这样做。是否有选项可以做到这一点,或者我是否可以完全卸载并重新安装?我认为文档意味着我可以在安装RUST之前设置“RUSTUP_HOME”和“CARGO_HOME”环境变量,这将导致“rustup”或安装程序将可执行文件放入“%CARGO_HOME%”中”。我没看错吗?
版本信息:
C:\>rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.73.0 (cc66ad468 2023-10-03)`
环境变量:
C:\Users\*JOE_USER*>echo "%CARGO_HOME%" && echo "%RUSTUP_HOME%"
"C:\Users\*JOE_USER*\OneDrive\Documents\Src\.cargo"
"C:\Users\*JOE_USER*\OneDrive\Documents\Src\.rustup"
这里是“RUSTUP”的多个重命名版本:
Directory of C:\Users\*JOE_USER*\OneDrive\Documents\Src\.cargo\bin
08/11/2023 09:38 PM <DIR> .
03/01/2023 10:06 AM <DIR> ..
08/11/2023 08:57 PM 8,594,944 cargo-clippy.exe
08/11/2023 08:57 PM 8,594,944 cargo-fmt.exe
08/11/2023 08:57 PM 8,594,944 cargo-miri.exe
08/11/2023 08:57 PM 8,594,944 cargo.exe
08/11/2023 08:57 PM 8,594,944 clippy-driver.exe
08/11/2023 08:57 PM 8,594,944 rls.exe
08/11/2023 08:57 PM 8,594,944 rust-analyzer.exe
08/11/2023 08:57 PM 8,594,944 rust-gdb.exe
08/11/2023 08:57 PM 8,594,944 rust-gdbgui.exe
08/11/2023 08:57 PM 8,594,944 rust-lldb.exe
08/11/2023 08:57 PM 8,594,944 rustc.exe
08/11/2023 08:57 PM 8,594,944 rustdoc.exe
08/11/2023 08:57 PM 8,594,944 rustfmt.exe
08/11/2023 08:57 PM 8,594,944 rustup.exe
这里是实际可执行文件的位置:
Directory of C:\Users\*JOE_USER*\OneDrive\Documents\Src\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin
10/16/2023 02:51 PM 22,269,440 cargo.exe
10/16/2023 02:51 PM 9,035,776 clippy-driver.exe
10/16/2023 02:51 PM 770,048 cargo-clippy.exe
10/16/2023 02:52 PM 4,706,304 test-bdd24cd8003a6271.pdb
10/16/2023 02:52 PM 6,868,992 std-287abad1c0bdb9b8.pdb
10/16/2023 02:52 PM 60,534,784 rustc_driver-ecc82c9d925511c8.pdb
10/16/2023 02:52 PM 265 rust-windbg.cmd
10/16/2023 02:52 PM 3,575,808 rustc_main-0b34c7ab06f9785c.pdb
10/16/2023 02:52 PM 112,128 rustc.exe
10/16/2023 02:52 PM 8,693,248 rustdoc.exe
10/16/2023 02:52 PM 1,699,328 test-bdd24cd8003a6271.dll
10/16/2023 02:52 PM 11,128,320 std-287abad1c0bdb9b8.dll
10/16/2023 02:52 PM 133,861,888 rustc_driver-ecc82c9d925511c8.dll
10/16/2023 02:52 PM <DIR> ..
10/16/2023 02:52 PM 1,354,240 cargo-fmt.exe
10/16/2023 02:52 PM 5,092,352 rustfmt.exe
10/16/2023 02:52 PM <DIR> .
.cargo
和
.rustup
目录并相应地设置
RUSTUP_HOME
和
CARGO_HOME
即可。您可能还需要调整
PATH
和类似的变量。