Rust

Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

Installation

For installation, it's advised to use rustup as it will (among other things) allow you to switch between versions of Rust without having to download anything additional.

brew install rustup

Use rustup to install the Rust compiler (rustc) and the Rust package manager (cargo).

rustup-init

Above command will add $HOME/.cargo/env to ~/.zshenv ~/.profile and ~/.bash_profile files. we don't need this as we add source "$HOME/.cargo/env" to ~/my/extra.zsh file.

when prompted Modify PATH variable? (Y/n) enter n

rm -f   .zshenv .profile  .bash_profile

To verify you can run:

rustc --version

To upgrade rustup

brew upgrade rustup
# or
rustup self update

Enable tab completion for Zsh

# rustup completions bash > $(brew --prefix)/etc/bash_completion.d/rustup.bash-completion
rustup completions zsh > $(brew --prefix)/share/zsh/site-functions/_rustup 

To update rust

rustup update
rustup update stable

Last updated