The recommended way to install Rust is to use "Rustup - The Rust toolchain installer".
It is included in most package managers, and can also be downloaded from rustup.rs.
Additionally, Rust requires a platform-specific linker and for some crates a dedicated C/C++ compiler.
If you have problems with winget, please see our FAQs.
On Windows, there are multiple options to get started with Rust. Choose one:
Native toolchain
Virtualized
For Windows on ARM, there exists no equivalent to MinGW-w64 and using MSVC it is not possible to compile some essential crates like ring. Please use LLVM instead.
Install Rustup and a standalone MinGW-w64 build from winlibs.org using winget and set the default toolchain using the following commands on the command line:
winget install Rustlang.Rustup winlibs
# reopen terminal
rustup default stable-gnu
Alternatively, manually download a release from niXman/mingw-builds-binaries or winlibs.org (preferably x86_64, posix, ucrt), extract it to suitable location (e.g. C:\mingw64) and add the bin-folder to your PATH (see FAQs).
Then download and execute rustup-init.exe from rustup.rs, choose Option 3 at the "Rust Visual C++ prerequisites", Option 2 "Customize Installation" and set the "Default host triple" to x86_64-pc-windows-gnu.
Download and execute rustup-init.exe from rustup.rs.
Choosing Option 1 at the "Rust Visual C++ prerequisites" should automatically download and install the Visual Studio Installer, MSVC build tools and the Windows 10/11 SDK.
If this is not working for some reason, please follow the corresponding documentation.
Untested, please consult your Artur on Errors :)
winget install Rustlang.Rustup LLVM.LLVM
# reopen terminal
rustup default stable-gnullvm
Alternatively, manually download and install a release from github.com/llvm/llvm-project or github.com/mstorsjo/llvm-mingw.
Then, download and execute rustup-init.exe from rustup.rs, choose Option 3 at the "Rust Visual C++ prerequisites", Option 2 "Customize Installation" and set the "Default host triple" to x86_64-pc-windows-gnullvm or aarch64-pc-windows-gnullvm according to your Machine.
Follow Microsoft's WSL Documentation and continue with the setup for Linux (Ubuntu).
TL/DR:
wsl --install on the command lineTo connect your IDE to the WSL, check the corresponding guides for VSCode and RustRover.
Follow Docker's installation docs or install Docker Desktop using winget on the command line:
winget install Docker.DockerDesktop
To build/run/test, run cargo within a Container using:
docker run -it --rm -v ${PWD}:/src -w /src rust cargo [build|run|..]
Alternatively, follow "How to use this image".
Install Rustup and GCC with your package manager:
brew install rustup gcc # macOS
sudo apt install rustup build-essential # Debian, Ubuntu, Linux Mint
sudo pacman -S rustup base-devel # Arch
sudo dnf install rustup @development-tools # Fedora
Install the stable toolchain as default toolchain.
rustup default stable
To validate your installation, create and run a sample project with cargo:
cargo new hello
cd hello
cargo run
> Hello, world!
In principle, you can use any text editor to write Rust code and build/test/run it with cargo via the command line. However, using a proper Rust IDE offers various advantages such as autocomplete, error diagnostics, build automation and others.
For beginners, suitable choices are Visual Studio Code + rust-analyzer and RustRover by Jetbrains.
If you are comfortable with another IDE you're allowed to use it, however we might not be able to support you adequately if you do.
Since the IDE uses your local toolchain, it is still your responsibility to set up a proper Rust installation!
As AI Tools are forbidden in the RoboLab, make sure to disable all AI backed Tools for Code Generation and Autocompletion!
Press Ctrl+, to open your Preferences, switch to your Workspace-Settings, search for chat.disableAIFeatures and enable "Disable AI Features"

Uninstall Plugin JetBrains AI Assistant:
Plugins...Installed, select the AI plugin and uninstall itDeactivate build-in code completion using remote suggestion package
Settings...Editor -> General
Code Completion and, on the right under Machine Learning-Assisted Completion, unselect the following:Sort completion suggestions based on machine learning
Inline Completionand, on the right, unselect the following:Enable local Full Line completion suggestions