Rust 1.78 (rustc)

Online Rust Compiler

Compile and execute memory-safe Rust programs with Cargo standard library. Write code with auto-formatting, test with standard input (stdin), and inspect terminal output in real-time.

✓ Borrow checker and memory safety diagnostics✓ Pattern matching, Enums, and Structs✓ Iterators and closures✓ Interactive stdin reading
main.rs
Rust 1.78 (rustc)
13px
Standard Input (stdin)
Passed to scanf, input(), cin, etc.
UTF-8Rust (rustc)2 SpacesWrap: Off
Ctrl+Enter to Run
Ln 1, Col 121 lines553 chars
Output & ConsoleIdle

Ready to Compile & Run

Click the blue ▶ Run button in the header bar or press Ctrl + Enter to compile and execute your Online Rust Compiler.

How to Run Rust (rustc) Code Online

Write and test Rust code with the rustc compiler, evaluating ownership, borrowing, and functional idioms.

  1. Write your Rust code with fn main().
  2. Click "▶ Run" or press Ctrl + Enter.
  3. Review compiler warnings or program output.

Common Errors & Troubleshooting

Encountering compilation or runtime diagnostics? Check these common scenarios:

cannot borrow as mutableDeclare variables as `let mut` if they require mutation.

Related Popular Language Compilers

View all 35+ compilers →
Python 3.py

Write, run and test Python 3 code in your browser with interactive standard input

JavaScript (Node.js).js

Execute modern ES6+ JavaScript code in an isolated high-speed runtime

TypeScript.ts

Type-safe JavaScript playground with instant transpilation and type validation

HTML / CSS / JS.html

Multi-pane web editor with live preview, responsive device frames and instant rendering

Frequently Asked Questions (Rust (rustc))

Yes, full rustc compiler borrow checking is enforced during compilation.