Zest.

Rust: Hello world

A short, tested Rust example for hello world. Copy it and adjust the names and paths for your project.

Rust
fn main() {
    println!("Hello, World!");
}

Save as main.rs, then run: rustc main.rs && ./main. In a Cargo project, use cargo run.

Find it in Zest

Search for “rust hello world” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More Rust examples

All Rust examples