← Back to archive

Stdle #25 · scope · 2026-07-01

What does this Rust snippet output?

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

const LIMIT: i32 = 3;
fn main() {
let mut count = 0;
let count = {
while count < LIMIT { count += 1; }
count
};
println!("{}", count);
}
Scope
4 attempts left

Answer & explanation