mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-21 19:16:23 +00:00
795 B
795 B
date | id | title |
---|---|---|
2020-08-27 | 33187ecc-81fd-4136-ad10-b69e8463bd6d | Rust tooling |
Rustc
Rustc handles Rust compilation rustc main.rs
Cargo
Cargo is Rust's build system and package manager
Cargo commands
Create project
cargo new hello_cargo
Build project
cargo build
Build & run project
cargo run
-
Backtrace
When you want to see an error backtrace set the
RUST_BACKTRACE
environment variable:RUST_BACKTRACE=1 cargo run
Check code
cargo check
Build for release
cargo build --release
Cargo.toml
[package]
name = "hello_cargo"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
[dependencies]