← Back to archive

Stdle #94 · scope · 2026-09-08

What does this Rust snippet output?

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

fn main() {
let x = 1;
let x = x + 1;
let y = {
let x = x + 1;
x * x
};
println!("{} {}", x, y);
}
Scope
4 attempts left

Answer & explanation