Rust Quick Run
Quickly compile, run, and debug individual Rust (.rs) files without needing Cargo or complex project setup. Perfect for beginners, quick prototyping, and learning Rust!

Features
🚀 Quick Run
Compile and run your Rust file with a single command or keyboard shortcut.
🐛 Integrated Debugging
Debug your Rust programs with breakpoints, variable inspection, and step-through execution.
📝 Syntax Checking
Check your code for errors without compiling the full executable.
🎯 CodeLens Integration
Click "▶ Run" or "🐛 Debug" directly above your main() function.
📊 Status Bar
See your Rust version and quick access buttons right in the status bar.
🔧 Problems Panel Integration
Compiler errors and warnings appear in VS Code's Problems panel with clickable locations.
Requirements
- Rust compiler (rustc) - Install from rustup.rs
- C/C++ Extension (optional) - Required for debugging support
Installation
- Install the extension from VS Code Marketplace
- Make sure
rustc is in your PATH
- Open any
.rs file and start coding!
Usage
Commands
| Command |
Keybinding |
Description |
| Rust Quick Run: Run File |
Ctrl+Shift+R |
Compile and run the current file |
| Rust Quick Run: Debug File |
F5 |
Compile with debug symbols and launch debugger |
| Rust Quick Run: Build File |
Ctrl+Shift+B |
Compile only, create executable |
| Rust Quick Run: Check Syntax |
- |
Check for errors without full compilation |
| Rust Quick Run: Clean |
- |
Remove compiled files |
| Rust Quick Run: Set Arguments |
- |
Set command line arguments |
Right-click on any .rs file in the editor or explorer to access:
- Run Rust File
- Debug Rust File
- Build Rust File
CodeLens
When you have a fn main() in your file, you'll see clickable links above it:
▶ Run | 🐛 Debug | 🔨 Build
fn main() {
println!("Hello, world!");
}
Configuration
| Setting |
Default |
Description |
rustQuickRun.outputDirectory |
System temp |
Directory for compiled executables |
rustQuickRun.optimizationLevel |
0 |
Optimization level (0, 1, 2, 3, s, z) |
rustQuickRun.showWarnings |
true |
Show compiler warnings |
rustQuickRun.clearTerminalBeforeRun |
true |
Clear terminal before running |
rustQuickRun.saveBeforeRun |
true |
Auto-save before compiling |
rustQuickRun.showCodeLens |
true |
Show Run/Debug above main() |
rustQuickRun.commandLineArguments |
"" |
Arguments to pass to your program |
Examples
Hello World
fn main() {
println!("Hello, World!");
}
Press Ctrl+Shift+R to run!
With Arguments
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
println!("Arguments: {:?}", args);
}
Use "Set Arguments" command to pass arguments to your program.
use std::io;
fn main() {
println!("What's your name?");
let mut name = String::new();
io::stdin().read_line(&mut name).unwrap();
println!("Hello, {}!", name.trim());
}
The integrated terminal handles input/output naturally.
Debugging
- Set breakpoints by clicking in the gutter
- Press
F5 or use "Debug File" command
- Use the debug toolbar to step through code
- Inspect variables in the Debug sidebar
Note: Debugging requires the C/C++ extension for Windows (cppvsdbg) or GDB/LLDB for Linux/macOS.
Troubleshooting
"Rust compiler not found"
Make sure rustc is installed and in your PATH:
rustc --version
If not installed, visit rustup.rs.
"Debugging not working"
- Install the C/C++ extension (
ms-vscode.cpptools)
- On Linux, ensure GDB is installed:
sudo apt install gdb
- On macOS, ensure LLDB is available (comes with Xcode)
"Permission denied" on Linux/macOS
Make sure the output directory is writable:
chmod 755 /tmp/rust-quick-run
| Platform |
Run |
Debug |
| Windows |
✅ |
✅ (cppvsdbg) |
| macOS |
✅ |
✅ (lldb) |
| Linux |
✅ |
✅ (gdb) |
Contributing
Contributions are welcome! Please visit our GitHub repository.
License
MIT License - see LICENSE for details.
Changelog
See CHANGELOG.md for version history.
Enjoy quick Rust development! 🦀