← Back to archive

Stdle #83 · ownership · 2026-08-28

What does this Rust snippet output?

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

fn bump(n: &mut i32) {
*n += 5;
}
fn main() {
let mut x = 1;
bump(&mut x);
bump(&mut x);
println!("{}", x);
}
Ownership
4 attempts left

Answer & explanation