Share Rust code with CodeThis

Rust shines when you want to share a snippet with borrows, lifetimes, and trait bounds intact. CodeThis highlights all of it.

Paste Rust now

What you get

  • Rust-aware syntax highlighting via CodeMirror
  • Instant shareable link — no signup required
  • Optional expiration (7 days, 30 days, permanent)
  • Password protection for private pastes
  • Works with the REST API and MCP server
  • Rich markdown and MDC components alongside code

Common use cases for Rust pastes

  • Minimal reproductions for compiler errors
  • Algorithm benchmarks
  • Trait and macro examples
  • FFI and unsafe demos

Example

fn fibonacci(n: u32) -> u64 {
    let (mut a, mut b) = (0u64, 1u64);
    for _ in 0..n {
        let next = a + b;
        a = b;
        b = next;
    }
    a
}

Related languages

Ready to share some Rust?