Skip to content

rustup update needs a cleaner error message if it fails while cleaning files - and no panic #4609

@john-cd

Description

@john-cd

Verification

Problem

rustup update needs a cleaner error message when it fails while cleaning files.

PS C:\Windows\System32> rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: checking for self-update

stable-x86_64-pc-windows-msvc unchanged - rustc 1.91.1 (ed61e7d7e 2025-11-07)

info: cleaning up downloads & tmp directories

thread 'main' panicked at src\utils\mod.rs:479:13:
Unable to clean up C:\Users\XYZ.rustup\tmp: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Steps

run:

rustup update

Possible Solution(s)

No response

Notes

Yesterday the whole internet went done because of a panic (thanks CloudFlare). Maybe we need to remove these unwrap()?

Rustup version

PS C:\Windows\System32> rustup --version
rustup 1.28.2 (e4f3ad6f8 2025-04-28)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.91.1 (ed61e7d7e 2025-11-07)`

Installed toolchains

installed toolchains
--------------------
stable-x86_64-pc-windows-msvc (active, default)
nightly-x86_64-pc-windows-msvc

active toolchain
----------------
name: stable-x86_64-pc-windows-msvc
active because: it's the default toolchain
installed targets:
  wasm32-unknown-unknown
  x86_64-pc-windows-msvc

OS version

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions