Rust toolchains: Difference between revisions

From wikinotes
No edit summary
Line 4: Line 4:
|-
|-
|}
|}


= rustc =
= rustc =
Line 13: Line 14:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- rustc -->
</blockquote><!-- rustc -->
= cargo =
<blockquote>
<code>cargo</code> is rust's build system and package manager.
<syntaxhighlight lang="bash">
cargo new my_project  # create project
cargo build          # compile project
cargo run            # compile/run executable
</syntaxhighlight>
<syntaxhighlight lang="toml">
[package]
name = "hello_cargo"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
[dependencies]
</syntaxhighlight>
</blockquote><!-- cargo -->

Revision as of 23:38, 7 September 2021

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]