Running Rust in Zerethon IDE

What Run compiles, the time limit, input, tests, and what a run cannot do.

Runs in Zerethon IDE · Rust 1.87 Official Rust documentation ↗
  • Run (Ctrl/⌘+Enter) compiles the entry file — main.rs by default — with rustc 1.87, edition 2024, and runs the program. Make another file the entry with the ▶ button next to it in the explorer.
  • Compiler errors appear in the Output tab with their code (error[E0382]), file and line; the program is not run. Warnings are shown too but do not stop the run.
  • Output and errors appear in the Output tab; what you type in the Input tab is the program's standard input.
  • Compiling and running together are stopped after 20 seconds. Memory is limited, there is no network, and the project files are read-only (write to /tmp).
  • Run tests (Ctrl/⌘+Shift+Enter) compiles and runs every file named test_*.rs as its own program. A test passes when it exits normally; a failing assert! or assert_eq! fails it. cargo test and #[test] functions are not used.
test_geometry.rs
mod geometry;

fn main() {
    assert_eq!(geometry::area(2, 3), 6);
    assert_eq!(geometry::area(0, 5), 0);
    println!("geometry ok");
}
A test for the geometry.rs module from “Modules and several files”.

Tip: The editor highlights Rust and completes keywords and common types. There is no formatter or live error checking yet: Run shows the compiler's messages, which usually say how to fix the problem.