← Back to archive

Stdle #56 · closures · 2026-08-01

What does this Rust snippet output?

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

fn adder(x: i32) -> impl Fn(i32) -> i32 {
move |y| x + y
}
fn main() {
let add10 = adder(10);
println!("{}", add10(5));
}
Closures
4 attempts left

Answer & explanation