rustup
rustup run
Run a command in the named toolchain environment without changing the persistent default. This example requires the specified compiler already installed. Example format: shell. Manual illustration; review prerequisites and side effects before execution. No automatic installation, updates, network calls or configuration changes. Expected result (not executed): The compiler reports version 1.85.0 if that toolchain is installed and the command succeeds. Common mistake: Treating a one-command override as a persistent change.
Formal Syntax & Structure
rust syntaxrust
rustup run TOOLCHAIN COMMAND [ARGS]Working Example
Example Snippetrust
rustup run 1.85.0 rustc --version