1. Hello, World!
Try editing println! to print your name and hit Run.
2. With variables and mutability
3. Second example on same page — proves multiple embeds work
4. Error handling — see compiler output
Try running, then fix the error and run again.
5. Nightly + 2024 edition + release mode
6. Explicit component usage (import)
Static code stays static
This block is plain ````rustwithoutplayground` — it remains a highlighted, non-runnable code block:
fn main() {
println!("This one is static — no Run button");
}Fence syntax:
```rust playground title="My Example" edition=2024 channel=stable mode=debug
fn main() { println!("hi"); }
```For MDX you can also use the component:
import { RustPlayground } from "@/components/ui/rust-playground";
<RustPlayground code={`fn main(){...}`} title="Example" />