← Back to archive

Stdle #13 · closures · 2026-06-19

What does this Rust snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

fn main() {
let x = 10;
let by_ref = || x;
let by_val = move || x;
println!("{} {}", by_ref(), by_val());
}
Closures
4 attempts left

Answer & explanation