Rust · online compiler

Run Rust online

Run Rust online — Rust 1.87 or the stable 1.x rustc, real borrow checker, isolated per submission.

Firecracker microVM live per-test verdicts multi-file compile

Rust is the memory-safe systems language: zero-cost abstractions, ownership and borrowing checked at compile time, no garbage collector. Increasingly the default for new infrastructure code (Cloudflare, Discord, Amazon).

ls-judge compiles Rust with the standard rustc inside a Firecracker microVM. The borrow checker is the real borrow checker — if it compiles here it will compile on your machine.

Single-file compile via `rustc`. Multi-file with `mod` declarations works. Cargo dependency fetches are unavailable (no network), so bring source you want to link.

Starter code

What you get in Rust

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

rust
Rust 1.87
use std::io;
fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let n: i64 = s.trim().parse().unwrap();
    println!("{}", n * 2);
}
stdin →21
expected →42
FAQ

Common questions about Rust on ls-judge

Which Rust?
A recent stable rustc — the current 1.x line.
Cargo?
For single-file playing, we invoke rustc directly. No crates.io fetches (no network).
async / tokio?
std async yes; tokio requires the crate — not available without a Cargo build.
Free?
Yes.
Further reading
Also try