Run Rust online — Rust 1.87 or the stable 1.x rustc, real borrow checker, isolated per submission.
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.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
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);
}
21
42