本文最后更新于 2024-03-04,本文发布时间距今超过 90 天, 文章内容可能已经过时。最新内容请以官方内容为准

Rust Installation

  1. Open the WSL2

  2. Install rust

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Some info pops up when installation done.

Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo’s bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source “$HOME/.cargo/env”

  1. Check the installation
rustc -V
    rustc 1.76.0 (07dca489a 2024-02-04)
cargo -V
    cargo 1.76.0 (c84b36747 2024-01-18)

if you see the version of rustc and cargo, then the installation is successful.

  1. Local Documentation
    if you want to see the documentation of rust, then you can use the command rustdoc --help

Ready to learn Rust

  1. Recommand the Vscode as the editor
  2. Recommand some plugins for rust in the vscode.
    1. rust-analyzer
    2. Rust Syntax
    3. rustfmt
    4. Error Lens

Everything is ready to learn rust.

More about installation

please see the official website