with rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Other installation methods are available at https://forge.rust-lang.org/infra/other-installation-methods.html.
update:
rustup update
❯ rustc --version
rustc 1.68.2 (9eb3afe9e 2023-03-27)
Visual Studio Code: https://code.visualstudio.com/docs/languages/rust
rustc src/main.rs
Example:
❯ rustc src/main.rs
❯ ./main
Hello, world!
cargo new hello
Example:
❯ cargo new print
Created binary (application) `print` package
or
cargo init print
Example:
❯ cargo init print
Created binary (application) `print` package
cargo run
Example:
❯ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
Running `target/debug/hello`
Hello, world!
cargo build
Example:
❯ cargo build
Finished dev [unoptimized + debuginfo] target(s) in 0.00s