User-defined Playground

Rust Programming Playground

A disposable Rust development environment with stable, beta, and nightly toolchains, cargo-watch, rustfmt, and clippy pre-installed.

Startup configuration
rust-01
Rust Programming playground: A disposable Rust development environment with stable, beta, and nightly toolchains, cargo-watch, rustfmt, and clippy pre-installed.

A disposable Rust development environment with stable, beta, and nightly toolchains, cargo-watch, rustfmt, clippy, rust-analyzer, codelldb, and musl cross-compilation target pre-installed. Full IDE support via VS Code with debugger. Runs on 4 vCPU / 10 GiB RAM / 100 GiB disk.

What's included

  • rustc / cargo — stable, beta, nightly
  • rustfmt — code formatter — stable, beta, nightly
  • clippy — linter — stable, beta, nightly
  • cargo-watch — recompile on file change
  • rust-analyzer — IDE intelligence (VS Code)
  • codelldb — native debugger (VS Code)
  • musl target — x86_64-unknown-linux-musl for static binaries

Key commands

New project

cargo new hello && cd hello
cargo run

Switch toolchain

cargo +nightly run          # run with nightly
cargo +beta build           # build with beta
rustup show                 # list installed toolchains

Watch mode

cargo watch -x run          # rerun on save
cargo watch -x test         # retest on save
cargo watch -x "run -- --flag"

Format and lint

cargo fmt                   # format all files
cargo fmt -- --check        # check without modifying
cargo clippy                # lint with suggestions
cargo clippy -- -D warnings # treat warnings as errors

Build

cargo build                 # debug build
cargo build --release       # optimized build

# Static binary (musl)
cargo build --release --target x86_64-unknown-linux-musl

Test

cargo test                  # run all tests
cargo test test_name        # run specific test
cargo test -- --nocapture   # show println! output

Toolchain management

rustup show                 # installed toolchains
rustup toolchain list       # all toolchains
rustc --version             # active rustc version
cargo --version             # active cargo version
rustup update               # update all toolchains
Start
Settings