Rust toolchains

From wikinotes
Revision as of 23:38, 7 September 2021 by Will (talk | contribs) (→‎rustc)
rust cargo


rustc

rustc is the rust compiler.

rustc foo.rs  # compiles 'foo' executable from foo.rs

cargo

cargo is rust's build system and package manager.

cargo new my_project  # create project
cargo build           # compile project
cargo run             # compile/run executable
[package]
name = "hello_cargo"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"

[dependencies]