Verification
Problem
This bug was originally discovered by @Cloud0310 , but due to operating system limitations, it could not be reproduced independently; I was able to reproduce the issue.
Currently, some tests incorrectly clear the properly installed Windows RustUp registry values while running. like:
cargo test --features test --test test_bonanza suite::cli_self_upd::uninstall_deletes_bins -- --exact --nocapture
This is a clear violation of the rules and will result in the properly installed version of Rust on the developers' computers being accidentally “uninstalled.”
Steps
- For test, backup
HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Rustup in anywhere
- Ran
cargo test --features test --test test_bonanza suite::cli_self_upd::uninstall_deletes_bins -- --exact --nocapture
- Values in the registry may be accidentally deleted. You can use
Get-ItemProperty -Path <mentioned key before> to verify this.
Possible Solution(s)
Decoupling File Deletion from Registry Cleanup
Notes
This is because the method for removing directories is tightly coupled with the method for removing files.
|
pub(crate) fn do_remove_from_path(process: &Process) -> Result<()> { |
|
let new_path = _with_path_cargo_home_bin(_remove_from_path, process)?; |
|
_apply_new_path(new_path)?; |
|
do_remove_from_programs() |
|
} |
Rustup version
rustup 1.29.0 (28d1352db 2026-03-05)
Installed toolchains
installed toolchains
--------------------
stable-x86_64-pc-windows-gnu
stable-x86_64-pc-windows-msvc (active, default)
stable-x86_64-unknown-linux-gnu
nightly-x86_64-pc-windows-msvc
1.78-x86_64-pc-windows-msvc
1.80-x86_64-pc-windows-msvc
1.86-x86_64-pc-windows-msvc
1.90.0-x86_64-pc-windows-msvc
1.93-x86_64-pc-windows-msvc
active toolchain
----------------
name: stable-x86_64-pc-windows-msvc
active because: it's the default toolchain
installed targets:
x86_64-pc-windows-msvc
x86_64-unknown-linux-gnu
OS version
Verification
Problem
This bug was originally discovered by @Cloud0310 , but due to operating system limitations, it could not be reproduced independently; I was able to reproduce the issue.
Currently, some tests incorrectly clear the properly installed Windows RustUp registry values while running. like:
This is a clear violation of the rules and will result in the properly installed version of Rust on the developers' computers being accidentally “uninstalled.”
Steps
HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\Rustupin anywherecargo test --features test --test test_bonanza suite::cli_self_upd::uninstall_deletes_bins -- --exact --nocaptureGet-ItemProperty -Path <mentioned key before>to verify this.Possible Solution(s)
Decoupling File Deletion from Registry Cleanup
Notes
This is because the method for removing directories is tightly coupled with the method for removing files.
rustup/src/cli/self_update/windows.rs
Lines 567 to 571 in 9773857
Rustup version
rustup 1.29.0 (28d1352db 2026-03-05)Installed toolchains
OS version
Windows 25H2(26220.8690)