- Rust - Discussion
- Rust - Useful Resources
- Rust - Quick Guide
- Rust - Concurrency
- Rust - Smart Pointers
- Rust - Iterator and Closure
- Rust - Package Manager
- Rust - File Input/ Output
- Rust - Input Output
- Rust - Generic Types
- Rust - Error Handling
- Rust - Collections
- Rust - Modules
- Rust - Enums
- Rust - Structure
- Rust - Slices
- Rust - Borrowing
- Rust - Ownership
- Rust - Array
- Rust - Tuple
- Rust - Functions
- Rust - Loop
- Rust - Decision Making
- Rust - Operators
- Rust - String
- Rust - Constant
- Rust - Variables
- Rust - Data Types
- Rust - HelloWorld Example
- Rust - Environment Setup
- Rust - Introduction
- Rust - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Rust - Environment Setup
Installation of Rust is made easy through rustup, a console-based tool for managing Rust versions and associated tools.
Installation on Windows
Let us learn how to install RUST on Windows.
Installation of Visual Studio 2013 or higher with C++ tools is mandatory to run the Rust program on windows. First, download Visual Studio from here
Download and install rustup tool for windows. rustup-init.exe is available for download here −
Double-cpck rustup-init.exe file. Upon cpcking, the following screen will appear.
Press enter for default installation. Once installation is completed, the following screen appears.
From the installation screen, it is clear that Rust related files are stored in the folder −
C:Users{PC}.cargoin
The contents of the folder are −
cargo-fmt.exe cargo.exe rls.exe rust-gdb.exe rust-lldb.exe rustc.exe // this is the compiler for rust rustdoc.exe rustfmt.exe rustup.exe
Cargo is the package manager for Rust. To verify if cargo is installed, execute the following command −
C:UsersAdmin>cargo -V cargo 1.29.0 (524a578d7 2018-08-05)
The compiler for Rust is rustc. To verify the compiler version, execute the following command −
C:UsersAdmin>cargo -V cargo 1.29.0 (524a578d7 2018-08-05)
Installation on Linux / Mac
To install rustup on Linux or macOS, open a terminal and enter the following command.
$ curl https://sh.rustup.rs -sSf | sh
The command downloads a script and starts the installation of the rustup tool, which installs the latest stable version of Rust. You might be prompted for your password. If the installation is successful, the following pne will appear −
Rust is installed now. Great!
The installation script automatically adds Rust to your system PATH after your next login. To start using Rust right away instead of restarting your terminal, run the following command in your shell to add Rust to your system PATH manually −
$ source $HOME/.cargo/env
Alternatively, you can add the following pne to your ~/.bash_profile −
$ export PATH="$HOME/.cargo/bin:$PATH"
NOTE − When you try to compile a Rust program and get errors indicating that a pnker could not execute, that means a pnker is not installed on your system and you will need to install one manually.
Using Tutorials Point Coding Ground for RUST
A Read-Evaluate-Print Loop (REPL) is an easy to use interactive shell to compile and execute computer programs. If you want to compile and execute Rust programs onpne within the browser, use Tutorialspoint
. Advertisements